Wordpress - display specific widget

fomicz picture fomicz · Nov 18, 2010 · Viewed 50k times · Source

I'm lost a bit.

Let's say I have a dynmic footer-siderbar. Easy so far.

<footer>
    <?php get_sidebar("name") ?>  
</footer>

Displys it in the footer.

But here we are. I want EACH widget inside of my grid:

      <footer>
         <div style="width: 100px:">
            <div style="width: 25%">First widget here</div>
            <div style="width: 25%">Second widget here<</div>
            <div style="width: 25%">Third widget here<</div>
            <div style="width: 25%">Fourth widget here<</div>
          </div>
        </footer>

So get_sidebar isn't an option now, since it displays all widgets in a row. And I don't want to edit widgets itself.

How they do that in themes?

Thanks.

Answer

Rhapsody picture Rhapsody · Nov 18, 2010

You can use the 'the_widget' function for this:

<?php the_widget($widget, $instance, $args); ?>

More information can be found on the Wordpress Codex - The_Widget reference.