I would like to have a "switch" in my template file that "reports" whether a widget exists in a dynamic sidebar so I can include an alternate sidebar file if no widgets have been assigned.
Basically, if there were no widgets dragged over in the Appearance / Widgets area, my alternate sidebar file will be used.
In this section of my template:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('left-side-widgets') ) : ?>
I would like to add something like:
<?php elseif no widgets : ?>
<?php /* include alternate sidebar file in dynamic sidebar */ ?>
<?php endif; ?>`
How can I create that "switch"?
Is it possible? Yes. By me, no... I tried. :-/
How do I create that query to the db to return the "switch"?
Additionally, how about also returning how many widgets were dragged over there?
And world peace.
I can use:
file_get_contents($someurl);
to grab the file if I must.
Thanks for any help...