• Resolved kmfischer3

    (@kmfischer3)


    I have added a sidebar to a page, but I need to update $dm_settings['left_sidebar'] in order for devdmbootstrap3_main_content_width() to account for it. How can I update this value, and what value do I set it to (1?) in order for the theme to know that I have a left sidebar? Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kmfischer3

    (@kmfischer3)

    Update: I found that the $dm_settings[‘left_sidebar’] is set in admin>appearance>devdmoptions when you select “show left sidebar”. However, when I do this, it gives sidebars to ALL the pages. Is there a way to modify this setting so only the correct page has a sidebar? Thanks

    Theme Author DevDm

    (@devdm)

    Hey kmfischer,

    The main display area column size is set inside the functions.php file using this function:

    function devdmbootstrap3_main_content_width_columns

    This function looks at settings array to see if the $dm_settings[‘right_sidebar’] and $dm_settings[‘left_sidebar’] are set.

    If they are it looks for $dm_settings[‘right_sidebar_width’] and $dm_settings[‘left_sidebar_width’] respectively and calculates the main column size with these widths subtracted from 12 (the default Bootstrap 3 grid size) returning the main column width.

    Anywhere the main column is used in a template file it opens with this div tag to grab the main width.

    <div class="col-md-<?php devdmbootstrap3_main_content_width(); ?> dmbs-main">

    Each of the left and right sidebars (ex. sidebar-left.php) has logic to see if they are even toggled before returning their set width from the $dm_settings global array of options

    <?php
        global $dm_settings;
        if ($dm_settings['left_sidebar'] != 0) : ?>
        <div class="col-md-<?php echo $dm_settings['left_sidebar_width']; ?> dmbs-left">
            <?php dynamic_sidebar( 'Left Sidebar' ); ?>
        </div>
    <?php endif; ?>

    What we have in essence is a system that only bothers with the left and right sidebar width if they are toggled and the function devdmbootstrap3_main_content_width_columns follows this same logic to return the correct main column width value.

    Hopefully this helps you a bit. If not we can dig deeper and I’ll need some links to see the behavior. You can email me [email protected] for help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where/when is $dm_settings['left_sidebar'] updated?’ is closed to new replies.