• 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.

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jh5512

    (@jh5512)

    I should add that I made a page template for my calendar page titled ‘Kalendar’. It goes like this:

    <?php
    /*
    Template Name: Kalender
    */
    ?>
    
    <?php get_header(); ?>
    <?php get_template_part('template-part', 'head'); ?>
    <?php get_template_part('template-part', 'topnav'); ?>
    
    <!-- start content container -->
    <div class="row dmbs-content">
    
        <div class="col-md-<?php devdmbootstrap3_main_content_width(); ?> dmbs-main">
    
        </div>
    
        <?php //get the right sidebar ?>
    
    </div>
    <!-- end content container -->
    
    <?php get_footer(); ?>

    And I have tried to change the “col-md-<?php devdmbootstrap3_main_content_width(); ?> to col-md-12 and its not helping. The result is the same. I get both a main col-md-9 wrapper as well as a col-md-3 sidebar wrapper (when I set my calendar to output its view on this page that is).

    Thanks for informing me about your post. Very thoughtful ?? Let’s see if someone can help us, with our layout problems. Here is mine again: https://www.ads-software.com/support/topic/month-view-shows-disturbing-design-elements-of-theme?replies=1

    Thread Starter jh5512

    (@jh5512)

    I found a hacky temporary fix that isn’t disabling the sidebar as I wanted but rather hiding it and upscaling the main wrapper to use 100% width.

    With this LESS code:

    body {
      	&.tribe-theme-child-devdmbootstrap3-child-mil{
      		.dmbs-main{
      			width: 100%;
      		}
      		.dmbs-right{
      			display: none;
      		}
      	}
    }

    So if anyone finds a solution to have my sidebar remain disabled on this calendar page, even after the calendar plugin is activated, I would still be interested in hearing how this would be done.

    Brook

    (@brook-tribe)

    Howdy jh5512,

    You could create a standard WP “Page Template” and then not show the sidebar in that template. You might already even have on created. Have you viewed the various template in WP-Admin > Events > Settings > Display? Does oine of those looks as you want, without a sidebar?

    Cheers!
    – Brook

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Theme layout issue on plugin’ is closed to new replies.