I’m having a custom sidebar called Footer. I’m displaying this sidebar using this code:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer') ) : ?>
(maybe I should do something in this line?) :)
<?php endif; ?>
This works smoothly, but almost every theme nowadays allow users to place their widgets in columns, just like there:
http://kaptinlin.com/themes/striking/
My markup looks like:
<footer>
<li id="plugin-name" class="widget widget_name">[widget]</li>
<li id="plugin-name" class="widget widget_name">[widget]</li>
<li id="plugin-name" class="widget widget_name">[widget]</li>
</footer>
And I want it to look like:
<footer>
<div id="column_1">
<li id="plugin-name" class="widget widget_name">[widget]</li>
</div>
<div id="column_2">
<li id="plugin-name" class="widget widget_name">[widget]</li>
</div>
</footer>
How to achieve that? (btw I don’t want to give width/height to my plugins, I want to create containers for them only)
I don’t know what plugins will user activate so I’m not able to use direct plugin linking. I have to grab 1st plugin, 2nd plugin, 3rd plugin etc., but I see no code allowing me to in Codex.
Use three sidebars an let them float. Anything else will break depending on the widgets your users insert.
You would achieve that when you first registered your sidebar within your functions.php file.
What this is going to do is create that wrapper for each widget that you wanted. Just call a single
dynamic_sidebar
call and wordpress will do the rest.