perfect!
and is implemented as I said!
very good correction!
I will put you among the contributors!
Sorry for the English, but use the google translator.
Hi,
Thank you. This is much of honor. The good idea and most of the code is still from you. But I appreciate it.
Hi I am attempting to use this Plugin/this code but despite having created the Sidebars, activated them, and assigning them to a page, nothing is being displayed.
Here is my sidebar template code:
<?php
$sidebars = empty($sidebars) ? array('multiple-sidebars-default') : explode(',', $sidebars);
foreach ($sidebars as $sidebar) {
if (is_active_sidebar($sidebar)) {
$success = dynamic_sidebar($sidebar) ? true : $success;
}
} ?>
Am I missing something?
Cheers,
Andy
These changes are only for function dynamic_sidebar() in the plugin code. In the current version of the plugin these changes are already implemented. You have to do nothing if you use the latest version.
I see. Well, doing nothing also did not work.
I tried to activate the sidebars using the Widget and that did nothing. I also tried to put the sidebar code as seen in the screenshot here (http://s.ww.wp.xz.cn/extend/plugins/multiple-sidebars/screenshot-3.jpg?r=548482), but that did not work.
What is the best way to get the Custom Sidebars I have created and activated to show up in my theme?
I use it in TwentyEleven the following way:
<?php
global $MultipleSidebars; // from plugin "Multiple Sidebars"
$useFallbackSidebar = true;
if ( method_exists( $MultipleSidebars, 'dynamic_sidebar' ) ) {
if ($MultipleSidebars->dynamic_sidebar()) {
$useFallbackSidebar = false;
}
}
?>
<?php if ($useFallbackSidebar && !dynamic_sidebar('sidebar-1')) : // use wp core sidebar functions ?>
// any basic fallback sidebar widgets
<?php endif; ?>
See sidebar.php in theme TwentyEleven for details.
Hi JochenT.
Thanks for the reply, I appreciate it.
I am using a child theme for TwentyTen theme. I tried your code as is, but it did not work.
I then modified it so it used TwentyTen code, but that is not working either. I can typically figure out things like these, so this is frustrating.
Here is the code I am trying…
<?php
global $MultipleSidebars; // from plugin "Multiple Sidebars"
$useFallbackSidebar = true;
if ( method_exists( $MultipleSidebars, 'primary-widget-area' ) ) {
if ($MultipleSidebars->primary-widget-area()) {
$useFallbackSidebar = false;
}
}
?>
<?php if ($useFallbackSidebar &&! dynamic_sidebar( 'primary-widget-area')) : // use wp core sidebar functions ?>
// any basic fallback sidebar widgets
<?php endif; ?>
Which is returning NOTHING at all, not even the “any basic fallback sidebar widgets” text
I have the MultipleSidebar widget placed in my Primary Sidebar, and my “Default Sidebar”.
Any thoughts?
Sorry, you need knowledge in PHP to understand this. Perhaps you may ask a friend to help you.
Hmmm..
Is there no way to have the Plugin just work? Most Plugins I’ve ever used work upon Activation. Sometimes I have to drop a line or 2 of code into a template file. But I have never needed thorough php knowledge to make a Plugin work according to its default behaviour. That is why i am confused. I don’t think I am attempting to make the Plugin respond to any custom behaviour at all.
Let’s take it a step backwards.
-I install and Activate the Plugin.
-I create a custom Sidebar.
-I activate the custom Sidebar in the Sidebars > Options menu
-I assign it to a specific page by dragging it from Inactive to Active in that page screen
-I drop the Multiple Sidebars Widget into my Primary Widget Area
Shouldn’t the custom Sidebar I created now be displayed on the Page I assigned it to? This is why I am confused. I follow basic instructions accordingly, but no Sidebar is displayed.
Any thoughts? Perhaps Plugin developer would know?
Hello, trulygood!
It seems very strange that the plugin does not work that way.
I would say that you first uninstall the plugin, and follow the steps I mention below:
1 – install the plugin
2 – Activate the plugin
3 – place the widget “Multiple Sidebars” in the default template sidebar
4 – create a page, post or custom post type, and from the menu on the right side, create a sidebar and place in the sector “active”.
I tried it and it worked. You might have a conflict with another plugin.
Sorry for the delay in answering, and for my English. I use google translate. 😉
If the above does not work, follow the steps 1, 2, 4, and places in the area, removing all the template code that references dynamic_sidebar. (or override it with ” /* OLD CODE */ “). and put in its place
<?php
global $MultipleSidebars;
if ($MultipleSidebars -> dynamic_sidebar ()) {
echo “No sidebars selected”;
}
?>
Good luck and hope it works and you solve a problem!
Hi Andrico,
Thanks very much for the response. I try both your suggestions, and no results.
There are no other Plugins installed and activated.
I tried with custom TwentyTen Child Theme, as well as TwentyTen itself. I even gave TwentyEleven a shot, no luck.
Perhaps you can take a look?
[email protected]