function test_largo_is_sidebar_registered_and_active() { $sidebars_widgets = get_option('sidebars_widgets', array()); // This sidebar is registered and active when tests are run $registered_and_active = 'sidebar-1'; $this->assertTrue(largo_is_sidebar_registered_and_active($registered_and_active)); // A sidebar that is definitely not registered and active $not_registered_and_active = 'not-registered-and-active'; $this->assertFalse(largo_is_sidebar_registered_and_active($not_registered_and_active)); }
<div id="content-main" class="span8"> <?php get_template_part('homepages/templates/top-stories'); // sticky posts box if this site uses it if (of_get_option('show_sticky_posts')) { get_template_part('partials/sticky-posts'); } // bottom section, we'll either use a two-column widget area or a single column list of recent posts if (of_get_option('homepage_bottom') === 'widgets') { get_template_part('partials/home', 'bottom-widget-area'); } else { get_template_part('partials/home-post-list'); } ?> </div> <div id="left-rail" class="span4"> <?php if (largo_is_sidebar_registered_and_active('homepage-left-rail')) { dynamic_sidebar('homepage-left-rail'); } else { ?> <p><?php _e('Please add widgets to this content area in the WordPress admin area under appearance > widgets.', 'largo'); ?> </p> <?php } ?> </div>