WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP query to display content of additional page (2 posts)

  1. DJJoshee
    Member
    Posted 5 years ago #

    Hi there,

    I've been using wordpress for some time now, and have done a few templates but built them on top of exisiting ones. I have come to the stage where I'm doing a fully customized one. You can see the demo at http://josh.r2x2.com/josh/bgg

    My issue is that I need to be able to get the content of a Page named "Home 2" into the right hand column. The left hand column is currently populated with the default index.php code and from the backend I'm using a "static" front page. So my question is how to write perhaps the WP_Query('') to grab the content for the second column, or there also seems to be a get_page_by_title() funtion that isn't all that well documented.

    Thanks in advance.

    Cheers

  2. DJJoshee
    Member
    Posted 5 years ago #

    NM,
    <?php
    $rightcolum = get_page_by_title('Home 2');
    setup_postdata($rightcolumn);
    ?>
    <div class="entry">
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.