Tag Info

Hot answers tagged

2

I managed to solve this myself. Instead of using register_sidebars() to register the sidebars all together, I simply used the singular register_sidebar() in a for loop, so that it registered a sidebar for every matching page. All one would need to do to get this working is change the template name (in my case template-generic-sidebar) to their own template ...


2

You can't. get_template() function has a protection against this. You will have to use include().


1

get_sidebar($name) will load a template sidebar-{$name}.php. If sidebar-{$name}.php does not exist, then it will fallback to loading sidebar.php. to have your specific sidebar, you can create a file sidebar-bibliography_sidebar.php in your theme with this code : <?php if ( is_active_sidebar( 'bibliography_sidebar' ) ) { dynamic_sidebar( ...


1

Looks like they are hard-coded into the sidebar. So you could manually remove them, but they'll just return when you update the theme. Best solution would be to make a child theme, if possible, and create a new sidebar without the unwanted widgets. EDIT: Remove <aside id="archives" class="widget"> <h1 class="widget-title"><?php ...


1

CODE UPDATED WITH = ADD UNLIMITED SIDEBARS (JavaScript) Create a function that register sidebars, using [register_sidebar][1], starting from an option: add_action('widgets_init', 'my_custom_sidebars'); function my_custom_sidebars() { $sidebars = get_option('my_theme_sidebars'); // get all the sidebars names if ( ! empty($sidebars) ) { // add a ...


1

The error you are getting is because you must add the registered sidebar to widgets_init. add_action( 'widgets_init', 'wpa199335_page_sidebar' ); function wpa199335_page_sidebar(){ register_sidebar(array( 'name' => __( 'Page Sidebar'), 'id' => 'page', 'description' => __( 'Displays on the side of pages with a sidebar' ...



Only top voted, non community-wiki answers of a minimum length are eligible