WordPress.org

Ready to get started?Download WordPress

Forums

Smart Archives Reloaded
[resolved] Include, instead of exclude categories? (8 posts)

  1. adamsmark
    Member
    Posted 3 years ago #

    Is there a way to change the "exclude" category function to "include"?

    I only want to show one or two categories.

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

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Sure:

    smart_archives( '', array(
      'category__in' => array( 1, 2 )
    ) );

    See WP_Query for more possible arguments.

  3. adamsmark
    Member
    Posted 3 years ago #

    I'm guessing that I should modify the plugin code (which I can do).

  4. adamsmark
    Member
    Posted 3 years ago #

    There are a lot of files for this plugin. Which file do I modify?

  5. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    You don't need to modify the plugin code.

    Just paste the lines above in your theme, where you want the archives to appear.

    You can even do it by including the shortcode in the content of a page:

    [smart_archives include_cat=1,2,3]

  6. adamsmark
    Member
    Posted 3 years ago #

    That works great. Thanks.

  7. opolily
    Member
    Posted 3 years ago #

    Exactly what I needed also! I'm really new at modifying our WP site and I have a hard time deciphering the documentation. Good examples really help.
    Thanks for asking the questions!

  8. lukeradl
    Member
    Posted 3 years ago #

    Thanks! Can this be done with authors in the shortcode as well?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic