WordPress.org

Ready to get started?Download WordPress

Forums

DevDmBootstrap3
[resolved] Show Left sidebar on one page template only (4 posts)

  1. borzoid
    Member
    Posted 9 months ago #

    I want just a right sidebar on most of the pages but both left and right on one particular page template.

    Is it possible to toggle the left sidebar on only for that template? If so how would I indicate that. I know I can is_page_template which works to a point but the content area width does not change to a one sidebar width.

    Also could you give a brief description of how the .less files work? I know they are for targeting styles but would like to understand how they are getting pulled into the stylesheets.

  2. DevDm
    Member
    Theme Author

    Posted 9 months ago #

    Sorry I missed this borzoid. They didn't notify me that there was a support inquiry!

    1) For now it might be best to wrap these lines in your is_page_template conditional and hard code the col size of your content area.

    <?php if ( is_page_template('mypagetemplate.php') ) { ?>
         <div class="col-md-6 dmbs-main">
    <?php } else { ?>
        <?php //left sidebar ?>
        <?php get_sidebar( 'left' ); ?>
        <div class="col-md-<?php echo main_content_width(); ?> dmbs-main">
    <?php } ?>

    2) The less files are there to assist your workflow. You do not have to use them and they are not getting compiled "on the fly" by the theme. They are there if you choose to use theme.

    I try to explain it better here LESS

  3. borzoid
    Member
    Posted 9 months ago #

    No worries - that's exactly what I did once I figured out how the col-# was calculated.

    Done some reading on the Less stuff - not using it but maybe in the future. Thanks for the link.

    While I have your ear - have you ever tried to implement equal column heights with jquery? Trying to but it's not getting the correct children divs.

  4. DevDm
    Member
    Theme Author

    Posted 9 months ago #

    I've done it with something like this
    where you grab the height of a div and set it for another.

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.