Fixing the Read More Tag Problem in WordPress Static Pages


WordPress has two ways of showing excerpts in a blog. One is by using the_excerpt() tag in your themes, and the other method is by using the more tag. The more tag allows you to specify where the cut off point is in a post while writing a post which makes it easy for the editor and allow you to show teaser content and such. However the more tag is used only on the home page which shows the latest posts. It does not work in Pages. Recently we encountered this issue and thanks to the WordPress forums we found the solution. If you want to turn on the read more tags in pages for showing partial posts, use the following code inside the loop:

<?php  global $more;  $more = 0;  ?>  //The code must be inserted ahead of the call to the content    <?php the_content('Continue Reading'); ?>

That’s it. If any of you theme designers ever get into this issue, then this should be a quick fix.

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.