Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #279817

    I have a Press category on my blog that I have built a ‘Press Sidebar’ for. It works great on the Press page but not on the individual post pages within the press category.

    I am trying this code in sidebar.php but it’s not working:

    if (in_category(Press)) {
        dynamic_sidebar('Press Sidebar');
        $default_sidebar = false;
    }

    It just keeps showing the default sidebar.

    I am stumbling. If someone can help here I would be much appreciated. Thanks.

    #279832

    Followup here that code was working to display the press sidebar but the Sidebar Blog elements were still displaying above them….

    • This reply was modified 10 years, 6 months ago by Raleigh.
    #279843

    Hi!

    Try with this plugin:
    https://wordpress.org/plugins/widget-logic/

    Regards,
    Josue

    #279845

    Josue thanks so much for the response.

    I’ve already considered that plugin as an option – a good option I’ve used on other projects.

    Trying to keep this site as plugin free as possible. I’ve already got it working with the above code I just stripped all the widgets out of the ‘Sidebar Blog’ and if I need widgets in the regular Blog category I’ll just treat it the same way as above since luckily all the post are already in a Blog category. So create a custom dynamic category for in_category Blog and go that route.

    I guess my situation is unique with all blog posts already in a blog category. So in that case we can mark this complete.

    Thanks!

    #279847

    Great news, you are welcome :)

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Show Custom WIdget Area per category on individual post pages’ is closed to new replies.