Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How can I add a ‘read more’ link to this loop?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #28730
    glenn_geiger
    Member

    The WP codex posted this great code snippet that will help me layout a page. It checks my pages to see if this page is a parent with any children, and if so, grab the content for the child page, and loop to the next one.

    Code:
    ID.’&sort_column=post_date&sort_order=desc’);
    foreach($pages as $page)
    {
    $content = $page->post_content;
    if(!$content)
    continue;
    $content = apply_filters(‘the_content’, $content);
    ?>

    ID) ?>”>post_title ?>

    TO add a read more link, I would usually add it like

    Code:
    the_content(‘Read More…’);

    The trouble with the code above is it calls the_content in this ‘apply_filters’ thing and I can’t just throw the read more argument in there.

    Any ideas how I could grab just part of the page? Or otherwise grab the_excerpt (even though I’m using pages)?

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.