• Has anyone a example for get_page_by_title()
    I tried to use it but no chance to run it. I tested something like that:

    <?php
    $rightcolum = get_page_by_title(‘test’);
    setup_postdata($rightcolumn);
    ?>
    <div class=”entry”>
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
    </div>

    But it don’t printe the content of test page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Spelling, perhaps?

    $rightcolum = get_page_by_title(‘test’);
    setup_postdata($rightcolumn);

    I’ve got this working (with the correct spelling), but it only shows my excerpt (using the <more> link) on the home page, and shows the full post on all other pages, including single.php. All pages are showing the exact same sidebar include. I would like it to show the excerpt on all pages, not the entire page contents.

    Ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_page_by_title’ is closed to new replies.