WordPress.org

Ready to get started?Download WordPress

Forums

Posts page - other content (4 posts)

  1. Andy
    Member
    Posted 3 years ago #

    Hey guys,

    I'm using WordPress as a CMS and have designated a posts page which displays the posts fine. What I'm looking to do is to display the post box content as well elsewhere on the page, but it doesn't seem to want to play ball. Is this possible and if so, what php do I need to display it

    Cheers

  2. Mike Schinkel
    Member
    Posted 3 years ago #

    This is a bit hacky, but it works. Past this after your the get_header() call in your theme template and modify to suite your needs:

    <?php $post = get_page_by_path($GLOBALS['pagename']); ?>
    <?php setup_postdata($post); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    <hr/>
    <?php rewind_posts(); ?>

    Hope this helps.

    -Mike

    p.s. To do it less hacky would require a lot more explanation. If you'd like to learn more we can probably do a better job of explaining over at http://wordpress.stackexchange.com.

  3. Andy
    Member
    Posted 3 years ago #

    Thanks Mike, that works perfectly. StackExchange is bookmarked. I'll be heading over there quite a bit I think!

  4. Mike Schinkel
    Member
    Posted 3 years ago #

    Glad it worked and that I could be of help. :)

Topic Closed

This topic has been closed to new replies.

About this Topic