Tag Info

New answers tagged

1

See this thread: WordPress admin menu formatting issue - there's a link there to download a plugin I wrote to temporarily work around the Chrome bug (which is what this is).


0

I have an other option as well if it is important to use one sidebar in template more than once, why not to use jQuery and clone that sidebar and by using once and appending that to specific section, but it is important not to use idz in sidebar because multiplications of idz is not valid and may cause layout breakage


-1

get_template_part( 'sidebar', 'recommendations' ) is fine and mostly in use by popular themes ie. "Enfold" Thanx for suggestion @Klian


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( ...


2

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


0

You are mixing up a couple of things here, namely register_sidebar() This is to register a sidebar so you can put stuff into it in the backend. get_sidebar() This just includes a file sidebar.php (or sidebar-nice-bar.php if you call get_sidebar('nice-bar')) from your current theme dynamic_sidebar() This actually displays the widgets you have added in ...


0

get_sidebar('left'); actually refers to a file, not the sidebar itself. Are you seeing the sidebar in the Admin section? Are you trying to display it on the front end? If the answer to both of these questions are "yes", then here's the solution: Create a file called sidebar-left.php. In this file, you will need to add your rendered HTML, something like ...


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' ...


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 ...


0

Lets try with below code function sidebar_widget_init() { global $_wp_sidebars_widgets; if ( empty( $_wp_sidebars_widgets ) ) : $_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() ); endif; $sidebars_widgets_count = $_wp_sidebars_widgets; $sidebar_count = count( $sidebars_widgets_count[ ...


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 ...


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 ...



Top 50 recent answers are included