• Resolved rtourtelot

    (@rtourtelot)


    Is it possible to display posts on a page that isn’t set up as the Posts page under Settings > Reading?

    The reason is that when I do this, it messes up the styling entirely. I have a template that I’ve created custom, and I’m using this code:

    if (have_posts()) :
       while (have_posts()) :
          the_post();
             the_content();
       endwhile;
    endif;

    If I set the page as my Posts page under Reading, the styling’s screwed up. If I don’t set it as the Posts page, no posts show up. Is there any way to force posts to appear here without setting it as the blog page? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • review:

    http://codex.ww.wp.xz.cn/Page_Templates
    http://codex.ww.wp.xz.cn/Page_Templates#A_Page_of_Posts

    it messes up the styling entirely

    you will need to replicate the html and CSS structure of, for example, the index template of your theme….

    set the page as my blog page under Reading

    that page will use index.php or home.php, but not the page template.

    what theme are you working with?

    Thread Starter rtourtelot

    (@rtourtelot)

    I’m working with the Adapt theme. The posts page initially had only excerpts, so I edited it to show the full content. :

    http://www.savenypl.org/site-test/news/ (viewing password: letmein )

    I can see how to edit the index.php file to display the sidebar… the only issue for me now is how to get the titles to show up! Any idea what’s happening there? I have it set to pull in the_content on the loop.

    Thanks again!

    Thread Starter rtourtelot

    (@rtourtelot)

    Ok, I added in:

    <h2 id=”post-<?php the_ID(); ?>”><?php the_title();?></h2>

    to my loop, and that seems to have added the title. Thanks for your help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Show posts on a template page’ is closed to new replies.