Best practice to check if sidebar has widgets
-
Hi,
What would you say is the best way to see if a sidebar that has been made with this plugin has widgets? I am currently using the method below which is not ideal.
<?php if (count(wp_get_sidebars_widgets()['widget-area']) > 0) : ?> <div class="col-12 col-lg-4 col-xl-3"> <?php get_sidebar(); ?> </div> <?php endif; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Best practice to check if sidebar has widgets’ is closed to new replies.