Forums

Make Page Display Categories instead (2 posts)

  1. ckadet
    Member
    Posted 1 year ago #

    Here is the page:

    http://habitswap.com/?page_id=178

    Right now, it displays ALL of the posts. However, I want to modify the code in this page so it displays content from only 1 category. This is the code of the page template for the page above:

    [Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

    Please tell me what to modify in the code above so it only displays one category in the page.

    Thanks,

    Chris

  2. t-p
    Member
    Posted 1 year ago #

    See if this guide helps:

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

    In the above link, take a look at this section:

    Show One Category by ID
    
    Display posts from only one category ID (and any children of that category):
    
    query_posts('cat=4');

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags