two widget areas in the sidebar
-
I want to use 2 separate widget areas in the sidebar. The first function is called “Right Sidebar Orange” (for orange boxes) and the second “Right Sidebar Blue” (for blue boxes), so this is my code in the sidebar.php:
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar ORANGE') ) ?> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar BLUE') ) : else : ?> Without Widgets <?php endif; ?>
The wordpress admin should be able to use either both widget areas or just one of them if they prefer one color.
Now, as you can see – with the above code they are able to use either BOTH areas or just the blue one. If they do not use the blue area, the no-widgets area will be displayed.What can I do to prevent that? I want the no-widget area to be displayed when – and only when – none of the two areas are used.
When I try to put both areas in one if condition using the or-operator || it does not work.
- The topic ‘two widget areas in the sidebar’ is closed to new replies.