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.
You can use the ‘the_widget’ function for this:
More information can be found on the WordPress Codex – The_Widget reference.
This is a good reference as well – Function Reference/dynamic sidebar « WordPress Codex
If you use the method on that page:
You could then use CSS styling to position the sidebar widgets across the footer.
Edit to include the following…
Arras theme CSS:
Footer coding:
In the theme it then places the widgets across the page.
Alternatively you can also use :
Please checkout my new plugin that displays a specific widget.
Visit:
http://wordpress.org/extend/plugins/widget-instance/
You can use Widget Options Plugin to restrict or control the widgets visibility on any pages and devices; available for free on the repository : https://wordpress.org/plugins/widget-options/. Or try using
widget_display_callback
https://developer.wordpress.org/reference/hooks/widget_display_callback/ . I hope this helps.