Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [register-sidebar]

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

0
votes
1answer
20 views

Save button is not working on custom widget

I created a custom widget according to Widget API and it seems to work until I make changes. The save button is not triggered, this problem is only affecting this new widget. Ps. The custom widget ...
0
votes
1answer
57 views

Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”

I have modified the tutorial at https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/plugin-sidebar-0/ to meet ES6+ but I am having trouble getting it to actually save to ...
0
votes
0answers
16 views

Creating dynamic Sidebar

I am newbie here, and I want to ask help regarding my issues. I am trying to create dynamic sidebar that will work same as with this site (http://www.taylor-dejongh.com/about/). there is left and ...
1
vote
1answer
24 views

How to add multiple custom widget areas

I'm looking to add multiple widget areas to a page in my theme as id like to have widgets within certain pages. I can add one using this code, I'm just struggling with a second. function ...
0
votes
0answers
32 views

Siderbar implementation with collapsible bootstrap cards

I'm trying to implement collapsible Bootstrap 4 cards on sidebar widgets, until now I have this: register_sidebar( array( 'name' => esc_html__( 'New Sidebar', 'ns' ), ...
3
votes
1answer
63 views

How to avoid widgets added to sidebar on theme activation?

I am registering 3 sidebars on widgets_init register_sidebar(array( 'name' => esc_html__('Left Sidebar','creatus'), 'id' => 'left', 'before_widget' => '<div ...
0
votes
1answer
33 views

How to enable the default sidebar area?

I have a theme created from scratch.I am able to create custom sidebar area and add widgets to it. But when i give this in index.php <?php get_sidebar(); ?> it shows some widgets rendered in ...
0
votes
2answers
277 views

register_sidebar function problem

What's wrong in this function? function init(){ //go through each sidebar and register it $sidebars = sidebar_generator::get_sidebars(); if(is_array($sidebars)){ foreach($...
0
votes
1answer
1k views

Can't see widget areas in my customizer

I've registered 7 Sidebars in my template, I can see them correctly in the Apparence > Widget panel and my front-end, but I can't see them in the Theme Customize, when I click on my Widget section I ...
2
votes
1answer
73 views

Wordpress widget new instance creates content duplicates

I have a custom made widget that I wrote and I want to display two instances of the same widget in the same widget area. When I drag and drop new widget instance to the widget area inside admin panel ...
0
votes
1answer
27 views

How to create sidebar from “scratch”?

I want to create a section on my website which will contain information about different locations, this section has tabs width different information: My idea was to register a sidebar and then use a ...
0
votes
1answer
335 views

My widgets do not save

Every time when I save my widgets and navigate away from the page, my widgets are gone. The sidebar is completely emptied and no change will be saved. I don't get any errors in the console or PHP log....
0
votes
1answer
68 views

Sidebar not appearing in footer, but it appears everywhere else!

Problem My sidebar is not displaying in the Wordpress footer.php file. functions.php <?php add_action( 'widgets_init', 'social_media_sidebar' ); function social_media_sidebar() { ...
2
votes
1answer
509 views

How to get the name and description of a sidebar in theme?

I have a sidebar registered (in functions.php) as: <?php register_sidebar( array( 'name' => __('Activity Calendar'), 'id' => 'activity_calendar_en', ...
3
votes
2answers
2k views

Add div class to only one widget

I want to add more classes in the div tag of my search widget. My search is located in the sidebar together with other widgets. My code: function NT_widgets_init() { register_sidebar( array( '...
0
votes
1answer
370 views

How to get sidebar widgets in leftsidebar template

I have created a custom sidebar widgets using below code : register_sidebar(array( 'id' => 'sidebar-widget-1', 'name' => 'Sidebar Widget 1', 'before_widget' => '', ...
0
votes
1answer
105 views

Register_Sidebar overwriting itself and doesn't exist in global $wp_registered_sidebars;

I have Dynamic sidebars that are generated based on terms of a taxonomy that were created. CLASS EXCERPT: public function __construct() { add_action('widgets_init', array($this, '...
0
votes
1answer
61 views

Dynamic sidebar areas not working on the Theme Customizer

I am trying to create one sidebar area per page in a WordPress site. For example, if a WordPress installation has 2 pages: 'Home' and 'Blog', then there'll be two sidebar areas, 'Home sidebar area' ...
0
votes
0answers
80 views

How Can I Replicate & Register a Widget from the Child Theme

I'm working with a WordPress theme which features a widget that uses the Google Maps API to display a map in the footer of the site. It works great, but seeing that we have two buildings, I would ...
0
votes
2answers
5k views

Wordpress error [closed]

Hi I have updated my wordpress site manually, now i get below mentioned error in the front and backend. Notice: register_sidebar was called incorrectly. No id was set in the arguments array for ...
1
vote
1answer
448 views

I can't get my custom widget area to show on my Wordpress site

I can't get my sidebar to appear on my site. I add a widget section since there wasn't any: function.php <?php if (function_exists('register_sidebar')) // Area 1 register_sidebar( array ( ...
0
votes
1answer
110 views

Wordpress Bootstrap Grid

What's the best way to create a grid layout using bootstrap, or see link below http://v4-alpha.getbootstrap.com/examples/carousel/ displaying three different headings, should i use wp-query or, ...
2
votes
1answer
319 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
538 views

Removing custom widget area WordPress 4.4 [closed]

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
1answer
232 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
65 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
87 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
2answers
1k 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 ...
3
votes
3answers
4k 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
711 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 ...
4
votes
1answer
2k 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
701 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
356 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
56 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 my ...
0
votes
3answers
1k 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
380 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
106 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), $post->...
0
votes
2answers
58 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 ...
1
vote
1answer
2k 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
1k 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', ...
1
vote
1answer
3k 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
27 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
21 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 ...
1
vote
0answers
73 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 ...
3
votes
0answers
405 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
448 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: http://codex.wordpress.org/...
1
vote
4answers
2k 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
189 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
71 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
45 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 ...