• Hi Folks

    I can’t seem to find a solution for this:

    I have a page that displays a blog category, so the url is

    mysite.com/category/tips

    which I’m happy with for displaying only posts of that category, however, I would like to have a sidebar that displays only archives for ‘tips’ instead of all blog posts.

    What would be the easiest way to accomplish this?

    Thanks

    • This topic was modified 4 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • Use a child theme to clone the archive.php (or category.php if there is one) template file, rename it category-tips.php and change it so it outputs either a sidebar that has what you want without widgets or calls in a new sidebar just for that template. You would have to register the new sidebar in the functions.php file.
    See the Template Hierarchy for how WordPress decides which template file to use.

    Edit: I’m not sure I gave the “easiest” way.
    If you have a widget that will do what you want, use a plugin like Dynamic Widgets to show different widgets on different pages.
    If you don’t have a widget, you could write one.

    Moderator t-p

    (@t-p)

    Check this plugin out https://www.ads-software.com/plugins/advance-category-posts-widget/

    Although it hasn’t been updated for last 9 months, at least you look at the source code and get some idea.

    Hello,

    Please check the below plugin URL, I think it should help you,
    1. Display Categories Widget
    2. WP Categories Widget

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating a category-specific archive sidebar’ is closed to new replies.