Using the "More" Tag on WordPress Pages

Post by 
John Crenshaw
Published 
October 16, 2014

Some of you may notice I've recently added a "blog" section to this site in addition to the existing "tutorials" section. Even though I use excerpts for my summaries in the tutorials section, I wanted to use the "more" tag in the blog section to accomplish the standard blog setup with the beginning of a post on the homepage and the rest on the single post page, with a "Read more" link allowing the reader to click through to the latter.

Two Blog Homepages

There's a small problem with having what essentially amounts to two blog homepages...one for the tutorials section and another for the blog section. The problem is that I have to tell WordPress to use one as the actual blog homepage, which, in my case, I've already set up to be the tutorials page. By default, WordPress won't let you use the "more" tag to clip posts on any pages other than the specified homepage. So, I did a little searching and found a really simple fix for this problem over at Weblog Tools Collection.

The Solution

The solution is incredibly simple, although, if you didn't do the exact same Google search I did you may have trouble finding it, so here it is.

All you have to do is add the following line just before the code to display your post content:

1
<?php global $more; $more = FALSE; ?>

So you end up with something like this on the page where you want your posts to be cut off (the "Blog" page in my case):

1
2
<?php global $more; $more = FALSE; ?>
<?php the_content('Read more &rarr;'); ?>

Why It Works

I haven't looked into the specific details on why this works, but it appears that WordPress uses the global variable "$more" as a flag to tell it whether or not the "more" tag should function on a given page. By default it's probably set for whatever page you specify as your blog's homepage, but not the rest. The code above sets the global variable "$more" equal to FALSE before displaying the post content so that WordPress respects the "more" tag on that page.

Ignoring the "More" Tag Once Again

Incidentally, you can set $more = TRUE immediately after displaying your content and WordPress will ignore the "more" tag in any posts following that one...like so:

1
2
3
<?php global $more; $more = FALSE; ?>
<?php the_content('Read more &rarr;'); ?>
<?php $more = TRUE; ?>

Never miss
an update

We never share your info. View our Privacy Policy
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
FOLLOW US ON SOCIAL
THere's More

Post you might also like

All Posts
Strategy
Jul
15
//
2020

Marketing Idea 0001: Target the Larger Audience

Sometimes customers that want to rent your product are actually better candidates to buy it.
SEO
Jun
13
//
2020

How to rank for "sunglasses" on Google

Paid Media
Jun
12
//
2020

PPC vs CPC: What's the Difference

They aren't the same thing, but they're pretty closely related
SEO
Jun
9
//
2020

Why SEO Content Fails

SEO
Jun
8
//
2020

SEO for Remodeling Contractors

Subscribe to Our  Channel