• Resolved Steve McKinney

    (@stemckinney)


    hello all,

    i want to display the content that goes in the wordpress editor for the blog page itself, while my posts are displaying i want to have a <h1> on the banner

    see: http://iamsteve.me/blog/

    <div id="blog_banner_bottom">
    	<?php the_content(); ?>
    </div>

    i want the content of the page blog to display there but it isn’t, i’m hoping you can tell me where i am going wrong

    if you need anything else to get a better idea i’ll provide it

    many thanks,
    steve

Viewing 9 replies - 1 through 9 (of 9 total)
  • Michael

    (@alchymyth)

    the_content(); needs to be in a wordpress loop.

    http://codex.wordpress.org/Template_Tags/the_content

    page templates do normally not display the content of the page they are assigned to.

    a minimal version of the loop in your above code might do:

    <div id="blog_banner_bottom">
    	<?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); endwhile; endif; ?>
    </div>

    not sure what you mean with the <h1>, could you elaborate?

    Thread Starter Steve McKinney

    (@stemckinney)

    i’ll give that a try but it’s confusing to explain but, each page has like a description in the banner which i have a different page layout for the posts page over the other pages, which as the posts page is different and is the page with the blog posts whatever i put in the blog actual page, and not an actual post won’t show before the posts

    if that makes any sense

    Thread Starter Steve McKinney

    (@stemckinney)

    still looking for an answer!

    Is that /blog/ a Page that you set to display blog posts under Reading Setting > Front page displays > Posts page: ?

    Thread Starter Steve McKinney

    (@stemckinney)

    yes, it’s my posts page

    Here’s a hint.

    Grab the id of that page. Use get_post() or get_page() then setup_postdata(). And then u can use the_content().

    Thread Starter Steve McKinney

    (@stemckinney)

    i’m pretty useless when it comes to php, but i’ve had a look at the codex and used my limited knowledge either way still don’t have much of an idea, so i hope you can point me in the right direction

    <?php
      $pageid = 'blog';
      $pageid = $blog;
      get_page($blog);
      setup_postdata($blog);
      the_content();
    ?>
    Thread Starter Steve McKinney

    (@stemckinney)

    it worked, thanks a lot!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Posts page not displaying the_content()’ is closed to new replies.