WordPress.org

Ready to get started?Download WordPress

Forums

posts in pages (5 posts)

  1. mlke
    Member
    Posted 7 years ago #

    tried searching, couldn't find anything...

    i want to display the posts for a category in a certain part of a created page.

  2. KatGirl
    Member
    Posted 7 years ago #

    You didn't look hard enough :)

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

    Common uses might be to:
    * Display only a single post or page on your homepage.
    * Show all posts from a particular time period.
    * Show the latest post (only) on the front page.
    * Change how posts are ordered.
    * Show posts from only one category.

  3. mlke
    Member
    Posted 7 years ago #

    can't seem to get it to work,

    i created the pages in the admin panel. i added the php code

    <?php query_posts('cat=1'); ?>

    nothing happens....

    is this wrong?

  4. moshu
    Member
    Posted 7 years ago #

    Yes, completely wrong.
    No code works if added to the content.
    You should create your own Page Template for it (see the Codex) and add the code to the template file. Then create a new Page using that template.

  5. mlke
    Member
    Posted 7 years ago #

    thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags