How to exclude a sidebar from showing on page template
-
I’d like to exclude right sidebar from showing on no-right-sidebar.php page.
See example below:
https://www.valgustid.net/exclude-right-sidebar/The contact page appears at the bottom no matter what I try to do.
The page doesn’t have <?php get_sidebar(); ?>, so tried using the following code in function.php:
* Disables sidebars
*
*/
function disable_sidebar( $sidebars_widgets ) {
global $wp_query;
if ( is_page_template( ‘no-right-sidebar.php’ ) ) {
$sidebars_widgets[‘primary’] = false;
$sidebars_widgets[‘secondary’] = false;
}
return $sidebars_widgets;
}No luck
Display widgets does the job, but I would like to remove the sidebar from the code.
Would appreciate any hints in the right direction.
Thanks
- The topic ‘How to exclude a sidebar from showing on page template’ is closed to new replies.