Dude, Where’s My More Tag?
I ran into an interesting dilemma today in WordPress where the <!--more--> tag was not displaying on some posts. After doing a little digging around in the WordPress Codex I finally came across the solution to my problem, and would like to share it with you today! The secret is pretty simple actually, but it’s something that may trip up developers unless they have a real in-depth knowledge of WordPress and its functions.
According to the WordPress Codex, “The <!--more--> quicktag will not operate and is ignored in Templates, such as single.php, where just one post is displayed.”
So that’s what I’d been doing wrong! I had made a copy of the front-page.php and turned it into a template for an individual page (page-4108.php), and while the <!--more--!> links appeared in the front-page.php, they simply were not appearing in my page-4108.php template which was, to the digit, an exact duplicate of front-page.php.
Well that’s just great…but there’s got to be a work-around, right?! Thankfully, there is! It comes to us in the form of the global variable, $more. The fix is actually quite simple: before you call the_content();, just add the global variable $more and set it to 0…like this:
<?php global $more;
$more = 0; ?>Now, when you go to load your page, you should see the “Read More” link wherever you placed the <!--more--> in your post body! A simple fix to an annoying problem, but hopefully this has saved you several hours of banging your head up against the wall and flipping back and forth between two identical files trying to figure out where you went wrong and why the universe chose today to pick on you!






Kevin, I added the commands you listed above to my page.php and as you stated, the more link appeared. However, when I click on the link it does nothing. I do I actually get the “more” content to display? I am only using pages (not posts). I am creating a website not a blog. In case that makes a difference. Thanks for your help.
Hi Julia, at this time it seems that the functionality of the more tag is limited to posts, and not pages. However, there are some workarounds to the problem in which you can create a function to limit the_content(); and then provide a “Read More” link which is hyperlinked to that page’s Permalink. Stay tuned for my next post in which I’ll show you how to do this! Thanks for reading!
Thank you Kevin