• tvallier

    (@tvallier)


    Hey,

    First, sorry this is in themes… it’s the closest I could come up with since I can’t create in the advanced area.

    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?

    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.

  • The topic ‘Extracting content before more tag from a page to index.php’ is closed to new replies.