Call sidebar from a template

Impossible with get_sidebar(). From that function’s body: function get_sidebar( $name = null ) { do_action( ‘get_sidebar’, $name ); $templates = array(); if ( isset($name) ) $templates[] = “sidebar-{$name}.php”; $templates[] = ‘sidebar.php’; So if you pass a $name or any other custom value to the function, they will be set between two fixed strings. You can … Read more

user definable sidebar per page

There’s a brute force method you can use. When you register your sidebar, you give it an ID and a name, then you use that ID and name on the sidebar template to display it. What if you appended the ID of the page to that identifier? So instead of ‘mainsidebar’ you had ‘mainsidebar’.$post->ID? Step … Read more

How to change links in the 3 main categories, on widget category, to a javascript function call

The Answer is: $(document).ready(function() { $(“#f-submenu”).hide(); $(“#m-submenu”).hide(); $(“#i-submenu”).hide(); $(“.widget ul li > a:not(ul li ul li>a, ul li+li ul li>a,ul li+li+li ul li>a )”).attr(“href”, “javascript:hideMenu();showSubMenu(‘m-submenu’)”); $(“.widget ul li+li > a:not(ul li ul li>a, ul li+li ul li>a,ul li+li+li ul li>a )”).attr(“href”, “javascript:hideMenu();showSubMenu(‘f-submenu’);”); $(“.widget ul li+li+li > a:not(ul li ul li>a, ul li+li ul li>a,ul li+li+li … Read more

Creating Multiple Admin Widget Page with Calling One Sidebar

Your code deletes keys from widgets. One of those keys is named ‘class’. When WordPress looks for the ‘class’ key it is missing and PHP reports that. I think you want this: $groups_sidebars = array(); foreach ( retrieve_widgets() as $widget ) { if ( array_key_exists( ‘groups-sidebar’, $widget ) ) $groups_sidebars[] = $widget; } $wp_registered_sidebars = … Read more