The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Custom Recent Posts Widget
exclude category (2 posts)

  1. mommysplurge
    Posted 3 years ago #

    I use a category as a tag to filter out certain posts that i use for my hacky database on my blog. i need to use the CRPW but exclude a category. i am happy to hardcode it into the widget, I just need a bit of help doing that. Would appreciate it if you have some code to do that!


  2. mommysplurge
    Posted 3 years ago #

    p.s. this is how i do it on the entry.php to filter out posts tagged with that category from being shown on the category page.

    if (is_category()) {
    // assign the variable as current category
    $categoryvariable = $cat;
    // concatenate the query
    $args = 'cat=' . $categoryvariable . ',-162';
    // run the query
    query_posts( $args );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Recent Posts Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.