วิธีแบ่ง Comment ออกเป็นหลายๆหน้า
ถ้าคุยเคยเจอปัญหาเวลาที่ Blog ของคุณมีคนมา Comment มากๆ มากเสียจนหน้านั้นมันยาวเหยียด โหลดก็ช้า สบายใจได้แล้วครับ วันนี้ผมมี plugin มาเสนอ รับรองว่าใช้แล้ว ปัญหา Comment ยาวเหยียดจะหมดไป เพราะต่อไปนี้ Comment ของคุณจะถูกแบ่งออกเป็นหน้าย่อยๆครับ
WordPress Paged Comment Plugin เป็นโปรแกรมที่ช่วยแบ่งหน้าของ Comment ใน post ของคุณออกเป็นหน้าย่อยๆ เพื่อไม่ให้ใช้เวลาโหลดที่มากเกินไป โดยเฉพาะที่มี Comment กันเป็นร้อยๆ พันๆ Comment
1. ไป Download plugin ได้ที่นี่เลยครับ
2. Unzip ออกมา จะได้ไฟล์ชื่อ paged-comments-config-sample.php ให้แก้เป็นชื่อ paged-comments-config.php
3. แล้ว upload ไฟล์ paged-comments.php กับ paged-comments-config.php ไปไว้ใน folder /wp-content/plugins/ ของเรา
4. เข้าไปยัง folder /paged-comments-plugin/themes/ ของ plugin นี้ จะเห็น folder ของ theme อยู่ ให้หาชื่อ theme ที่ตรงกับที่เราใช้ เพราะว่าเราจะต้อง upload file อีก file แต่ถ้าหาไม่เจอ ให้เลือก default ครับ
5. เมื่อเข้าไปใน folder ของ theme ที่ตรงกับเราแล้ว เช่น default ให้ upload comments-paged.php (/paged-comments-plugin/themes/default/comments-paged.php) ไปยัง folder themes ของเราบน /wp-content/themes/ บน server wordpress ของเรา
6. Login ไปที่ wp-admin ของเราแล้วเข้าไปที่ Presentation > Theme Editor แล้วเลือกแก้ไข file Single Post (single.php) กับ Page Template (page.php)
7. หา tag comments_template(); แล้วแก้เป็น if (function_exists(‘paged_comments_template’)) paged_comments_template(); else comments_template();


8. Save แล้วไป Activate Plugin ได้เลย แค่นี้ก็เสร็จแล้วสำหรับ WP2.0
หน้าตาตัวอย่างที่แบ่งหน้า Comment แล้ว

เรายังสามารถเรียงลำดับของ Comment ได้ กำหนดจำนวน Comment ต่อหน้า และยังสามารถทำ SEO friendly ของ link ของ Comment หน้าอื่นๆได้ โดยแก้ไขใน file paged-comments-config.php
หวังว่าคงเป็นประโยชน์สำหรับ Blog ยอดฮิตหลายๆท่านนะครับ
Leave a comment
Recent Post
- พาทัวร์ Facebook Datacenter ใหม่
- เว็บข่าว Digital Business ไทยๆ Thumbsup.in.th
- เปรียบเทียบ iPhone 4 กับ iPhone 3GS
- ปลูกผัก (Facebook) VS ปลูกผัก (จริง) [InfoGraphic]
- Google Instant
- Upgrade WordPress เป็น 3.0.1 เสียที
- ฤา การเมืองจะเข้าสู่สงครามโลก Cyber
- Adsense ปรับขนาด font ได้แล้ว
- เปรียบเทียบ iPhone 3G กับ iPhone 3GS
- สรุป WWDC 2009 กับ iPhone 3GS
Categories
- Adsense (26)
- Amazon (5)
- Apple (4)
- Blog Tips (22)
- Build Traffic (3)
- Check Photo (5)
- Chitika (5)
- Facebook (2)
- Google (4)
- Life (1)
- Make Money (22)
- Plugin (8)
- Search Engine Optimization (1)
- Sweden (1)
- Talks (57)
- Technology (17)
- Themes (2)
- Travel (2)
- Web 2.0 (9)
- Web Business (19)
- Wordpress (29)
- Youtube (1)





It\’s a great and valuable site!