• MtnExile

    (@mtnexile)


    I would have thought this would be a cinch. I simply added the WordPress loop to a static page and voila! Except, no voila.

    The only thing it picks up is the title of the page, with no content and no excerpt. So, for instance, if you want to have a list of posts on the “About Us” page, all I get is a single post titled “About Us.” Clicking it is recursive: it simply takes you back to the same page.

    The really curious thing is that I do have a list of posts in the sidebar. I copied the same code into another file and loaded that as an include, and it still gives me a single post with the page title and nothing else.

Viewing 2 replies - 1 through 2 (of 2 total)
  • racer x

    (@racer-x-1)

    The WordPress Loop does not mean it is always all your posts in a loop. It may be “all” or even only one post that matches the query criteria. (the url request)

    For example, when you go to the About page, wordpress looks for that post because it knows that is what you want.

    There are many ways to create loops that will list all your posts or even posts from only a certain category, etc. However, you WILL want to have a better understanding of the loop and how to create custom loops.

    Best of luck!

    Thread Starter MtnExile

    (@mtnexile)

    But I DID use a loop looking for only a certain category:

    <?php query_posts($query_string . '&cat=3'); ?>

    This is what works for the sidebar; it doesn’t work in a page. And if WordPress “knows” that what I want is an About Us post, WordPress is wrong.

    So my original question still stands: how do you generate a list of posts on a static page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add a list of posts to a page?’ is closed to new replies.