New theme compatibility function
-
Hi,
I needed a way to know if the sidebar/corral have any widgets in order to add specials classes in my theme and I didn’t find any method to do it in the plugin files, so I made my own :
I added it in the “backwards-compat-functions.inc” file :
/** * Check if sidebar/corral cotaint widgets or not */ function ww_is_active_sidebar($corral_slug) { global $widget_wrangler; if(count($widget_wrangler->page_widgets[$corral_slug]) > 0) { return true; } else { return false; } }
So you just need to call it in your theme like so :
ww_is_active_sidebar('your-corral-slug');
Where ‘your-corral-slug’ should be replace by the corral you need to check.
Hope it help.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘New theme compatibility function’ is closed to new replies.