Registers a single sidebar and returns the ID. Call on "widgets_init" action.

learn more… | top users | synonyms

0
votes
0answers
25 views

How to hide default sidebar widgets?

I'd like to hide/not display all default widgets(Search, Recent Posts, Recent Comments, Archive, Categories and Meta) which are inserted into custom sidebar when the theme is installed. (Removing them ...
2
votes
2answers
71 views

WP available widget for certain area

After searching under the tag widget and Google the closest I have found that populates what I am looking for is this article: Is there a way to allow only certain type of widgets in the sidebars? I ...
2
votes
0answers
46 views

Removing custom widget area WordPress 4.4

I know it is a very simple thing but I just cannot figure it out. I always used to define widget areas and sidebar in source code, however this time I have used the UI option from Appearance > ...
0
votes
0answers
23 views

Registered Sidebar Display Issue

I am new to WordPress so the answer is probably obvious. I have 2 registered sidebars and I'm "get"ing them both in my archive.php but they aren't showing up. Here is the code for just one of them ...
0
votes
0answers
19 views

Dynamic sidebars

I have functionality in place to create dynamic sidebars. So the user can use default sidebars or create their own sidebars. The code for creating custom sidebars: global $my_theme_option; ...
0
votes
1answer
33 views

Undefined index: custom_sidebars

I am implementing custom sidebars on a theme I am developing. Everything works fine when I add new custom sidebars. However, when if I remove these new added custom sidebars I get the error Undefined ...
0
votes
0answers
16 views

custom sidebars don't appear in wp-customizer's widgets section

I'm adding Custom Sidebars as Post Type like here the sidebars appears correctly in Widgets page [.../wp-admin/widgets.php] and widgets appears correctly in their position .. of course i'm using ...
0
votes
0answers
43 views

Create new sidebars trough admin post/page metabox

I have this bit to register sidebars dynamically: function my_custom_sidebars() { $sidebars = get_option('my_theme_sidebars'); // get all the sidebars names if ( ! empty($sidebars) ) { // add a ...
1
vote
0answers
38 views

Can you target a widget_class in a register_sidebar?

Using Bootstrap 3 to create a WordPress theme I am using register_sidebar() for the sidebar: if ( function_exists( 'register_sidebar' ) ) { register_sidebar( array( 'name' => __( ...
0
votes
1answer
62 views

Add the title of a widget as an ID - for anchor links

I'm currently building a WordPress theme where my page consists of widgets. One widget is a part of the page. I'd like to be able to use anchor links with them, and to do this, I would like to output ...
1
vote
1answer
91 views

Text Widget creates a <li>

I've got a basic text widget and, outside the standard <div class="textwidget"> wrapper there is a <li id="text-5" class="widget widget_text"> (which I have not added when creating the ...
0
votes
1answer
66 views

How can i display custom menu in sidebar?

I would like to display a custom menu in a custom sidebar instead of author information or blank space i.e custom menu with similar styles as default menu but only in vertical manner as displayed in ...
1
vote
1answer
49 views

Get custom side bar on custom post archive page

I have a custom post type called “bibliographies” and the corresponding archive-bibliographies.php file to show a list of posts. On this page I want to add a side bar that is unique to this page, so I ...
0
votes
2answers
93 views

Adding an extra sidebar to your theme

I want an extra sidebar added to this wordpress theme of mine. I want it right under my left sidebar and not next to it as it is currently showing: www.giftforgag.com. I have tried many things but ...
0
votes
1answer
33 views

Sidebar only shows up on blog page

I am currently working on a theme that uses a Page Sidebar for the Contact, About, Portfolio and Home pages, and a Blog Sidebar for the Blog page. For some reason, the Page Sidebar is not showing up ...
2
votes
1answer
22 views

Registering multiple sidebars with data from an array

I am attempting to dynamically register sidebars for certain pages. The pages must meet the following criteria: be published be a page (not a post) use the template 'template-generic-sidebar' In ...
0
votes
3answers
325 views

register_sidebar / dynamic_sidebar with sidebar id

I am trying to get rid of the following error in debug: Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array ...
1
vote
3answers
89 views

How the WordPress sidebar works

Ok, the title is surely not good to explain my very basic question, but here it is: I just started creating a wordpress theme and the index.php has two columns: 1.) The main content and 2.) A ...
1
vote
1answer
44 views

How can you add a link to a sidebar description?

How can I add a link to a sidebar description? $sidebar_description = sprintf(__( 'Sidebar for the <a href="%s">%s</a> post', 'themetext' ), get_permalink($post->ID), ...
0
votes
2answers
32 views

How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?

I've replaced the WP search on my site with a Google CSE. Google has a nice feature that lets you specify that certain areas of the page should not be indexable, by adding a "nocontent" class to those ...
0
votes
0answers
31 views

Register Widget Areas from Custom Widget

Is this possible to register sidebar / widget area from a custom widget?. If you have any idea please let me know. I can create it from custom theme and custom plugin. But I want to create from ...
1
vote
1answer
165 views

Add before_content and after_content to register_sidebar

Is there any way to add two new functions, before_content and after_content to the register_sidebar function? These would work like before_title and after_title, except it would wrap everything that ...
0
votes
1answer
73 views

widgets not working

I pasted my siderbar widget code in widgets.php file function right_sidebar_widget() { register_sidebar( array( 'name' => 'Right Siderbar', 'id' => 'right-siderbar', ...
0
votes
0answers
73 views

Add class to links inside widget

So I'm working on a theme and I'm using Ian Lunn's collection of css hover effects. Currently I'm adding the classes I want through the dashboard (appearance>menus) which adds the class to the li that ...
1
vote
1answer
260 views

Adding Multiple Sidebars

Hello all I would like to add multiple sidebars to my wordpress site I currently have 2 sidebars registered in functions.php like so: function themename_widgets_init() { register_sidebar( array( ...
0
votes
0answers
64 views

Unique widget id to target specific part of widget

I am currently trying to target widget part after title and collapse it on smaller screen where title would be a toggle. This is in my footer area and there are 3-4 widgets that I want to collapse on ...
0
votes
0answers
17 views

Call Multiple Sidebars at once

I have multiple sidebars registered for my site's footer, called footer-1, footer-2, and footer-3. It will be a 3 column layout in my footer. What is the best way to call these 3 sidebars? Should I ...
0
votes
0answers
20 views

Any reason why widgets/menus get emptied when I updated custom theme code?

Deployed my site over git last nite, and client came back saying some menus in the the footer widgets had disappeared. I looked in the admin, and the widgets were still available but all the items ...
0
votes
0answers
48 views

Displaying Custom Sidebar Without Modifying Theme's Core File?

Is there a way to display custom sidebar created with a plugin on the wordpress front-end without modifying theme's core file? EDIT: Here is what I currently doing: I hooked the custom dynamic ...
2
votes
0answers
64 views

Widget area inside a widget

I tried putting dynamic_sidebar('widget-id') inside a custom widget I created and it worked. The only thing I can't figure out is how I can do this through a loop. Is there a way that when the widget ...
0
votes
1answer
94 views

Why the dynamic_sidebar() call is putted into an ul tag?

I am pretty new in WordPress development and I have the following doubt about how the sidebar are putted into a WordPress theme. Looking into the official documentation: ...
1
vote
3answers
500 views

Cannot save widgets in custom sidebars

I'm working on a child theme of the Toolset Bootstrap Theme. I need to create a custom sidebar, so I registered the new sidebar in my child theme's function.php file: function ...
2
votes
1answer
110 views

Insert Widget option into mark-up with register_sidebar

I have added a custom field to my all widgets in my theme, called "custom-title". I have managed to save the field into the database for each widget, like so: s:12:"custom-title";s:17:"HELLO TEST ...
0
votes
1answer
37 views

Is there a way to dump all registered sidebar/widget?

I need to know the properties of sidebar and widgets I've added, is there a way to dump those? Thanks.
0
votes
0answers
38 views

Widget Areas Still Appearing in WP ADMIN When They Shouldn't

I had a bunch of "Widget Areas" registered for my theme. I removed a few and added a few. The ones which I removed, I deleted the code which is hooked on widgets_init for registering the sidebars. I ...
0
votes
1answer
147 views

$before/after_widget/title not displaying anything

I have built a custom widget with this code: class rfw_dock extends WP_Widget { function __construct() { parent::__construct('rfw_dock', __('TITLE'), array( 'description' => __( ...
0
votes
0answers
27 views

How to select widgets top bottom?

i'm add widgets in functions.php: register_sidebar(array('name'=>'sidebar1')); register_sidebar(array('name'=>'sidebar2')); in index.php how to code: set options sidebar1 or sidebar2 to top ...
1
vote
1answer
94 views

unregister_sidebar() in stand-alone theme not working

With this StackOverflow Q&A I can't make the unregister_sidebar() work for me. Scenario I have developed a theme using a sidebar area, where I've used a Widget. But I don't want the 'Editor' to ...
0
votes
0answers
64 views

Why isn't my registered sidebar showing up in the admin?

I'm using sidebars in my mega menu drop downs to let the admin add widgets specific areas of the menu: <ul class="sub-menu"> <li class="sub-menu-item first"> <ul> ...
0
votes
0answers
60 views

wp_register_sidebar_widget in loop within a plugin?

I'm trying to dynamically create widgets based on a posts from a post type. The code is as below. This function is pulled from my plugin class: public function initWidgets() { // Config ...
2
votes
1answer
2k views

is_active_sidebar() not working

why the is_active_sidebar() function return always false? Function.php code: if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name' => 'Footer Column 2', 'id' ...
0
votes
0answers
100 views

register_sidebar() will not wrap an element properly

I am trying to add a widget for for some reason I cant wrap an element around the widget. Here's the html in the index.php: <article class="intro-widget"> <p> ...
1
vote
1answer
986 views

How do I override a sidebar that is registered in a parent theme when using a child theme?

I currently am using a child theme, and its parent theme has registered sidebars already.. My. problem is that i want to change the parent theme's dynamic sidebar From: register_sidebar(array( ...
0
votes
1answer
846 views

How to pass a special CSS class into widget li

I have assigned a Sidebar into functions.php: register_sidebar( array ( 'name' => 'Footer Widgets Area', 'id' => 'footer_widgets_area', 'description' ...
1
vote
1answer
224 views

wp_register_sidebar_widget() disappered my Widgets submenu - what am I doing wrong?

Working on a theme made by someone else as an official duty. At first it's causing error in the wp-admin Widgets page — not working at all. Then the first thought came to my mind was ...
0
votes
2answers
547 views

2 dynamic sidebars registered, not showing up

My intention is to have a left and right sidebar on each page. I've registered both of them, implemented my desired widgets, and yet something isn't quite right. The left sidebar (sidebar(1)) loads ...
0
votes
1answer
436 views

Widget title markup in register_sidebar

How come the markup I specify in the 'before_title' and 'after_title' settings of register_sidebar gets applied to the default text WordPress widget but not one of our custom widgets, when both are in ...
3
votes
1answer
173 views

What is the use case for the “Class” parameter in register_sidebar?

I registered a new sidebar and filled in the class parameter (see code), I then dropped in an Archive widget and went hunting for my "testing" class. Not there. So what is the class parameter used ...
3
votes
3answers
4k views

HowTo: Add Class to Sidebar Widget List-Items

The newest version of Bootstrap (v3.0) adds a new List Group component which has the following structure: <ul class="list-group"> <li class="list-group-item">Cras justo odio</li> ...
0
votes
1answer
116 views

key( $GLOBALS['wp_registered_sidebars'] ) is always showing the same value

I am using this code from another answer add_action( 'dynamic_sidebar', 'wpse_96681_hr' ); function wpse_96681_hr( $widget ) { static $counter = 0; // right sidebar in Twenty Ten. Adjust ...