• I am interested in disabling the custom sidebars for posts appearing in a specific category. What is the best way to go about doing this? I can create a new category sidebar and populate it with nothing but then just the blank sidebar area shows. I would rather disable it in its entirety so that I can make a custom category page that will show the post as i like it.

    Please let me know what command I should use and which file I should put it into.

    Thanks

    https://wordpress.org/plugins/custom-sidebars/

Viewing 1 replies (of 1 total)
  • Hey there rezac1,

    Hope you’re well today!

    This is not possible out of a box with the current version of the plugin. It would require adding some custom code. You’ll have to make modifications to the template where single posts are displayed. Adding something like this in your single.php:

    Replace where it says:

    get_sidebar();

    with this one:

    if(is_single() && has_category( 18, $post)) {
       // nothing
    } else {
       get_sidebar();
    }

    Where 18 is category ID. This should remove sidebar from posts that are in specific category.

    Please let me know if this helps 🙂

    Best regards,
    Bojan

Viewing 1 replies (of 1 total)

The topic ‘Disabling custom sidebars for specific category posts’ is closed to new replies.