Twenty Eleven: Content not showing up in Page template (7 posts)

  1. databell96
    Posted 5 years ago #

    I made a special template for one of the pages in my theme. I know there's a new format for this in Twenty Eleven. One I'm still a bit confused about so I could use some assistance.

    I created my theme and then did the following:
    <div class="entry-content">
    <?php the_content(); ?>
    </div><!-- .entry-content -->
    </article><!-- #post-<?php the_ID(); ?> -->

    Problem is my content isn't showing up.

    Any idea why? I need to get this working and soon.

  2. Michael
    Forum Moderator
    Posted 5 years ago #

    do you have any wordpress loop code in that template?

    please post the full code of your template (please use the http://pastebin.com/ if the code is longer tha 10 lines)

  3. databell96
    Posted 5 years ago #

    No, I don't think I do. But then I noticed the new page template(s) for TwentyEleven don't seem to use the loop either. Anyway, Here's the PasteBin link.

  4. Michael
    Forum Moderator
    Posted 5 years ago #

    possible way to add the loop:


  5. databell96
    Posted 5 years ago #

    Yep, that worked! Thanks, Alchymyth. Out of curiosity, would that also apply for display comments? I'm trying to do something similar with a category archive where all the posts appear on the left and a comments form and list of comments on the right. Form appears but comments don't but I don't have a loop going on either.

  6. Michael
    Forum Moderator
    Posted 5 years ago #

    you possibly need to put a loop around the comments part as well;

    to get the posts/comments, you might need to add a rewind_posts(); before the while( have_posts() ) : line in that part.

  7. databell96
    Posted 5 years ago #

    Well, that didn't work. Comments still won't appear. I think it's because it's a unique situation where I'm trying to create a form and have the comments appear for all posts instead of for an individual post which comments normally appear for.

    So I create a PasteBin for that as well. Here's that link:

Topic Closed

This topic has been closed to new replies.

About this Topic