[wp-hackers] Displaying until the more tag of a page?

Tommy Vallier tommy at tommyvallier.com
Wed Nov 19 23:52:11 GMT 2008


Hey folks,
I'm building a site with a few hundred pages in an insanely complicated
parent-child setup. Each page has several paragraphs of text and each also
contains a more tag after either the first or second paragraph.

I'm looking to pull the content before the more tag to the front page. We're
looking at featuring specific pages every week/2-weeks/month and this would
let us show only the start and leave a "read more" link to follow.

I've found this little workaround:

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

But it doesn't seem to be doing the trick... I'm thinking because it's being
used on the home page (currently index.php, could just as easily be
home.php).

Any thoughts?

Tommy

*And before someone asks: They're pages and not posts because of the URL
structure we're looking to achieve. Can't have two categories with the same
URL slug even if they have different parent categories - you can with page
parent-child relationships.*


More information about the wp-hackers mailing list