url ภาษาไทยแสดงไม่ครบบน wordpress

ในกรณีที่เราทำ permalink ใน wordpress แล้วนำหัวข้อของบทความเรามาทำเป็น url ด้วยซึ่งถ้าเกิดหัวข้อของเราเป็นภาษาไทยและมีความยาวมากๆ ระบบก็จะตัดคำทิ้ง ทำให้เวลาแสดง url ที่เป็นภาษาไทยแล้วจะแสดงออกมาไม่ครบ มีวิธีแก้ไขดังนี้ครับ

1. ให้เราไปที่ไฟล์ wp-includes/formatting.php แล้วหาโค็ดนี้ครับ

$title = utf8_uri_encode($title, 200);

แก้ตัวเลขจาก 200 ไปเป็นเลขที่สูงกว่า เช่น 1000 จากนั้นเซพ

2. เข้าหน้า phpmyadmin ของฐานข้อมูล wordpress ของเราจากนั้นกดที่ wp_posts แล้วเลือกที่ Structure

3. จากนั้นแก้ไขในส่วนของ post_name

4. แก้ Length/Values1 จาก 200 ไปเป็น 1000 แล้วทำการเซพ

เสร็จละครับเท่านี้ url ภาษาไทยของเราก็จะแสดงออกมาครบ

ขอบคุณ : http://www.thaiseoboard.com/index.php/topic,101076.0.html

บทความแนะนำ
  • http://pulse.yahoo.com/_54SX4CWH6V3WKKBBHSQ756B3BI watcharaphon

    จะมีผลต่อ post ก่อนหน้า ทำให้หาไม่เจอรึไหม

  • http://www.pad-soa-th.com VeryHistory

    ไม่ได้ค่ะมีปัญหา มันฟ้องว่า
    Warning: Cannot modify header information – headers already sent by (output started at /home/pr862848/public_html/wp-includes/formatting.php:1) in/home/pr862848/public_html/wp-content/plugins/qtranslate/qtranslate_core.php on line 71TDOMF ERROR: Headers have already been sent in file /home/pr862848/public_html/wp-includes/formatting.php on line 1 before session_start() could be called. This may be due to…Your current wordpress theme inserting HTML before calling the template tag “get_header”. This may be as simple as a blank new line. You can confirm this by using the default or classic WordPress theme and seeing if this error appears. You can also check your theme where it calls “get_header”.

blog comments powered by Disqus