Widget Visibility
-
I am having the problem that the is_active_sidebar() function is returning true for all pages even when there is no widget being displayed. I am using the Jetpack Widget Visibility plugin. When the widget is set to display only on the front page it does but the is_active_sidebar function returns true for all other pages as well. Any ideas?
The goal is to have a different class depending on whether there are widgets on the page or not. I am currently doing it like this:
<?php if ( is_active_sidebar('primary-widget-area') ) { $class="with-sidebar"; } else{ $class="without-sidebar"; } ?> <body <?php body_class($class); ?>>
- The topic ‘Widget Visibility’ is closed to new replies.