• Resolved nolaflash

    (@nolaflashcom)


    Working in custom theme and would like to get sidebar setting for page and if none is set present a default sidebar. My failed attempt is below. How do I grab the value for the page’s sidebar in my templates?

    Thanks!

    <?php if ( is_active_sidebar( 'sidebar-no-news' ) ) { ?>
            <div class="col-sm-4">
                <div class="side-bar row-fluid">
                    <?php dynamic_sidebar( 'sidebar-no-news' ); ?>
                </div>
            </div>
    	<?php } else {  ?>
        	<div class="col-sm-4">
                <div class="side-bar row-fluid">
                    <?php dynamic_sidebar( 'sidebar' ); ?>
                </div>
            </div>
        <?php } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Setting a default sidebar / detect if a sidebar is set’ is closed to new replies.