Theme layout issue on plugin
-
Im using a child theme of the theme ‘DevDmBootstrap3’ thats using bootstrap to control the main area as well as sidebars.
Furthermore I have made a filter function to use the parents theme hook that controls the 12 colums available based on the sidebar settings.
My function looks like this:
function jh_deregister_sidebar_per_page() { //gets the parent theme variable array that stores view areas //such as main, right_sidebar, left_sidebar global $dm_settings; $columns = '12'; //checks if current page is Kalender, if so set right sidebar to 0 if (is_page('Kalender') ) { $dm_settings['right_sidebar'] = 0; } if ($dm_settings['right_sidebar'] != 0) { $columns = $columns - $dm_settings['right_sidebar_width']; } if ($dm_settings['left_sidebar'] != 0) { $columns = $columns - $dm_settings['left_sidebar_width']; } return $columns; } add_filter( 'devdmbootstrap3_main_content_width_hook', 'jh_deregister_sidebar_per_page' );
Notice the if(is_page(‘Kalender’), which does the magic I need, I want to display the output of your plugin on my Kalender page. I am able to disable my sidebar on my ‘Kalender’ page with my code just fine, except when I activate the calendar plugin and set it up to output its view on that page. Then my main area is changed from col-md-12 to col-md-9 and a useless sidebar that I don’t want on this page re-appears with a col-md-3.
So how can I view the calendar output of your plugin in a main col-md-12 div wrapper without having that annoying sidebar (I can’t globally disable it because I need it on other pages).
The problem can be seen on https://www.jh-dev.dk/MIL/kalender , the sidebar I don’t want has the H3 ‘Relaterede sider’ in a div class=”col-md-3″ wrapper.
- The topic ‘Theme layout issue on plugin’ is closed to new replies.