WordPress.org

Support

Support » Plugins and Hacks » Smart Archives Reloaded » Exclude category and sticky post

Exclude category and sticky post

  • sanjoyroy

    @sanjoyroy

    OK, I have 2 category archives going on my site (which is all on my local disk, not online yet). The first archive is called News, category id=’1947′, and I got SmartArchives to display only the news category fine with the following code:

    <?php
    $sar_args = array(
      'format' => 'block',
    );
    $query_args = array(
      'category__in' => '1947'
    );
    smart_archives( $sar_args, $query_args );
    ?>

    With my other archive – which is everything else – I want to exclude the News category ‘1947’, and a single sticky post with id=’5405′. So I tried this code, but it’s not working (News and sticky post is still included in the smart archive):

    <?php
    $sar_args = array(
      'format' => 'block',
    );
    $query_args = array(
      'category__not_in' => '1947'
      'p' => '5405'
    );
    smart_archives( $sar_args, $query_args );
    ?>

    Any ideas what is wrong?

    http://wordpress.org/extend/plugins/smart-archives-reloaded/

  • The topic ‘Exclude category and sticky post’ is closed to new replies.
Skip to toolbar