Ready to get started?Download WordPress


Custom Recent Posts Widget
exclude category (2 posts)

  1. mommysplurge
    Posted 1 year 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 1 year 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

About this Topic


No tags yet.