Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Hook for disabling sidebar on custom post types?

Home / Forums / Pinnacle Theme / Hook for disabling sidebar on custom post types?

This topic is: Not Resolved
[Not Resolved]
Posted in: Pinnacle Theme

Tagged: ,

May 3, 2018 at 3:39 pm

Hello! I have a plugin that adds get_sidebar(); on it’s singular custom post type pages, and while removing that piece of code works, it comes back every time on plugin update. So I’m looking for a theme hook that I can use to disable sidebars on the archive and singular pages.

Something like this:

`function kad_sidebar_on_listing_page($sidebar) {
if (is_singular(‘listing’)) {
return false;
}
return $sidebar;
}
add_filter(‘kadence_display_sidebar’, ‘kad_sidebar_on_listing_page’);’

But that does not work. (Plus, even if it did, it would only work for singular pages, so I would need to add in code to do the same for archive pages.

The plugin is IMPRESSListings, and the front-end of the CPT is copelandcompany.com/listing, if that helps.

Thank you! Tom

  • The forum ‘Pinnacle Theme’ is closed to new topics and replies.