WordPress.org

Ready to get started?Download WordPress

Forums

Exclude all but one category in wp list cats (3 posts)

  1. jarret
    Member
    Posted 7 years ago #

    I know I can exlude selected categories but am wondering whether it's possible to do the inverse ie. include ONLY a given category, thereby excluding all other categories? For example, list only category id 4 and exclude all others including ones that might be added in future.

  2. ryoken
    Member
    Posted 7 years ago #

    query_posts('cat=4');

    more info at http://codex.wordpress.org/Template_Tags/query_posts

  3. jarret
    Member
    Posted 7 years ago #

    Almost but as far as I understand it this works only in the loop. I'm looking for something that will work within the sidebar.

    thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags