Questions tagged [sidebar]

A Sidebar is a theme feature introduced with Version 2.2. It's basicly a vertical column provided by a theme for displaying information other than the main content of the web page. Themes usually provide at least one sidebar at the left or right of the content. Sidebars usually contain widgets that an administrator of the site can customize.

153 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
296 views

Display Single Attachment Image file size, uploaded date, resolution, file-name etc in Sidebar

Sorry for any wrong details. I am totally new to WordPress development. I am running a photo site. On single attachment page, I want to show the details (i.e upload date, filename, size, resolution) ...
2
votes
0answers
98 views

How To Remove/hide some specific categories from two different categories widget from sidebar

I have two categories sidebar widgets with different topics on my site. I want to hide some specific categories from each of the widgets. Is there any way to do so? Suppose I have total Categories ...
2
votes
0answers
449 views

Add Icons to the Product Category Sidebar Widget WooCommerce

I have been searching for this since yesterday. It's weird the little info is there about this simple function, I suppose that's because the answer is too obvious. But I didn't find the way to display ...
2
votes
0answers
127 views

How to get sidebar's content inside admin-ajax?

I'm using a modal to display some content via an admin-ajax request. Now I have problem outputting the content of a sidebar (text widgets, used for adding advertisement scripts). When I directly use ...
2
votes
0answers
178 views

Wordpress menu that shows all posts in a certain category like w3schools

I am working on creating a widget menu(kind of a sidebar like w3schools) that is supposed to show all posts that are listed in a particular category. And update automatically from particular category(...
2
votes
1answer
286 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 ...
2
votes
2answers
2k views

Multisite Widget/Content

I'm using WordPress multisite and need to display content across all subsites in the sidebar. This is a network of 50+ sites so updating all 50+ sidebars with this content every few days is not ...
2
votes
2answers
2k views

Full width layout for custom post type pages

I'm trying to remove a widget area called 'Primary' from a certain page on a site. This is the function where I manage the sidebars: //ADD CATEGORIES IN SIDEBAR OF SINGLE POST TYPE add_action( '...
2
votes
0answers
65 views

Get sidebars depending on page

Is there a way to get only the sidebars used on a particular page? Using: global $wp_registered_sidebars; $widget_map = wp_get_sidebars_widgets(); Can get me all of the sidebars, but I'm interested ...
1
vote
1answer
26 views

display menus on all page except one?

I'm not very good at this, so please bear with me. I have a Wordpress site with sections for different cites, and the different cities each have their own nav menu which shows for all of the pages in ...
1
vote
0answers
14 views

How to display custom sidebar in wordpress 5.5.2

I am trying to display a custom sidebar in worpress 5.5.2 latest version but i have registered one sidebar in functions.php and in sidebar i want to display it so i put code to display in sidebar.php ...
1
vote
0answers
82 views

Wordpress CPT save metadata in gutenberg

I'm trying to wrap my head around the new sidebar api vs metabox issue when trying to come up with how to save metadata for a custom post type. I've got a couple websites I'm going to be creating that ...
1
vote
1answer
30 views

How to handle many different menus?

I'm developing a site that has about 200-300 pages, that each needs a custom side-menu, linking to primarily internal pages. So here's one sidebar: Link to /foo Link to /bar Link to www.example.org ...
1
vote
0answers
28 views

customise template to only show custom post type entries

How do I customize a template for a custom post type to only show the categories and recent entries for that post type? I'm assuming that if my cpt is "newsletter", then I start with a single-...
1
vote
0answers
547 views

the_widget() - filter only one instance

If I have 3 widget instances like: the_widget( 'WC_Widget_Cart', array( 'title' => 'Cart 1' ) ); the_widget( 'WC_Widget_Cart', array( 'title' => 'Cart 2' ) ); + the same widget assigned to a ...
1
vote
1answer
106 views

Can wordpress post and sidebar remain visible after scroll?

My problem is that I have a long sidebar and most posts are somewhat short so when the user scrolls down after the end of the post they only see blank space on the left and just the sidebar on the ...
1
vote
0answers
295 views

Adding tag's featured image to tag archive

I'm looking for a way to add a featured image to post tags, then display it on that tag's archive page. I currently have the name and description displayed in the sidebar, using a custom sidebar ...
1
vote
1answer
422 views

Include a sidebar on the static front page of twenty thirteen

This is my first child theme (2013) attempt and its going along nicely (with a huge learning curve), but I can't seem to find out how to include a sidebar to my static home page or front page. I know ...
1
vote
1answer
54 views

Theme developement – incative sidebars

Im staring to develop a theme but i have a litle issue. I’m trying to add a sidebar to my theme with this code: function theme_2_widgets_init() { register_sidebar( array( 'name' =>...
1
vote
0answers
404 views

How to get the sidebar HTML content?

I'm trying to get the sidebar HTML output to filter the <img> tags and change its src attributes, but I couldn't so far. I tried with this code inside of dynamic_sidebar filter hook, but didn't ...
1
vote
1answer
135 views

Trying to create dynamic widget area using post ID

In functions.php I added this code. function page_widget_init( $post_id = 0 ) { { register_sidebar( array( 'name' => __( 'Page Widgets', 'seven_theme' ), 'id' => 'page-...
1
vote
0answers
95 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' => __( '...
1
vote
1answer
585 views

Do not show one specific widget on one specific page

Using a child theme of genesis and am unsure of how to remove a contact us widget in sidebar from the contact us page. Is there an easy way to do so? It's part of the theme which has it on the side ...
1
vote
0answers
565 views

How to create pagination for homepage with widgetized area?

I have created homepage with sidebar area filled with different widgets. Each widget fetch and display posts from different categories. Now I need to create a numbered pagination in homepage which ...
1
vote
0answers
76 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 ...
1
vote
1answer
99 views

Displaying details of a post in a sidebar

I am developing a wordpress theme but m still new into and was learning. Basically, its a theme for resource website which provides web templates. In my theme i've created a details section in sidebar ...
1
vote
1answer
615 views

How do you List all Sidebars in a Metabox

I know this question has been answered many times before, including here where i came from so it'll probably be real simple. I've registered my sidebars as normal function wmw_sidebars() { // ...
1
vote
1answer
130 views

Admin option sidebar count

I need to add a count number to a option menu item in the admin sidebar. How is this done? I found a similar post: Modifying admin sidebar contents to show pending posts indicator
1
vote
1answer
138 views

Generate sidebar depending on height of post

I'm building a site which features sidebars next to each post/article displaying random thumbnails linking to other posts. Each sidebar should never be longer/bigger than the post it's sitting next ...
1
vote
2answers
43 views

author list not linking to correct page

I have an odd problem with the author list. I am using the below code in my sidebar to pull in the gravatar and link to author's profile. However, the links it's actually generating are wrong. It just ...
1
vote
1answer
305 views

How to call widget by widget's id?

Is it possible to call widgets using it's id? for example I have a sidebar. In this sidebar I put meta widget and tag cloud widget. I have got their id's ($widgets_list): 'meta-2' and 'tag_cloud-2'. ...
1
vote
2answers
104 views

Action when sidebars updated

Is there any action that triggers after the sidebars have been updated? For example, for menus, I use wp_update_nav_menu, but I didn't find any way to do something alike with sidebars.
0
votes
0answers
27 views

Add class to anchor links and other elements in a widget

I'm building a theme that follows the BEM methodology. I've added the following to functions.php: function nav_bem_anchor_element( $atts, $item, $args, $depth ) { $atts['class'] = 'header__nav-...
0
votes
0answers
37 views

Custom sidebar isn't showing up on sub-category posts

I have a magazine style website that has custom sidebars. If someone posts something under the category of Culture, I have culture sidebar that shows up. Under entertainment, the entertainment sidebar ...
0
votes
0answers
31 views

How to hide the sidebar and topbar in specific admin page

I would like to hide the sidebar and top bar (refer image below) on specific page, that is to focus on the content of the page itself. Because on this specific page, I would like to get it using ...
0
votes
0answers
12 views

How do I use the default style for widget?

I added the twitter feed sidebar widget on my website, as seen below. but the theme makes the text / background unreadable. How do i use the default style for it / prevent the theme from changing it? ...
0
votes
1answer
79 views

WordPress Gutenberg core/heading block (wp-block-heading)

I am really not sure how to write the code. How do I get all the headings from the page? To be specific, core/heading. I wanted to make a sidebar so that the user can just jump from one section to ...
0
votes
1answer
59 views

different sidebars depending on template (is_page_template is not working)

I'm trying to follow the instructions in this "How to show different sidebars for posts and pages in WordPress" tutorial to use different sidebars for different types of pages. In particular,...
0
votes
0answers
12 views

How to assign a sidebar to a Wordpress page when none was there before

Hi and sorry for this possibly silly question. But how can I add a sidebar to a page in WP 5.6.2 that currently does not have a sidebar? Thanks in advance for your help! Steve
0
votes
0answers
183 views

Mobile Menu and Mobile Sidebar missing

My mobile menu and mobile sidebars are not working. When I click on the icon it only adds a # sign to the url and nothing happens. I have deactivated all the plugins and activated them one by one. The ...
0
votes
0answers
17 views

Need to make sidebar responsive only when screen width is greater than 1024px

I'm new to WordPress and I want to make my sidebar responsive when the screen width is greater than 1024px. currently, the sidebar becomes responsive when the screen width is greater than 768px. The ...
0
votes
1answer
185 views

Gutenberg sidebar show input field on toggle

I have been trying to learn about Gutenberg, React, ES5, ES6, Babel, Webpack JSX for the last few days. I must say it feels like I dove into some sort of wormhole... The only thing I wanted was to add ...
0
votes
1answer
93 views

Passing state from child component to parent component in a Gutenberg Sidebar

I'm setting up an sidebar that include controls for some custom meta fields. I've got a parent functional component that include some inner child components, and I'd like to toggle (show/hide) ...
0
votes
1answer
25 views

Loading Widgets Via Child Theme

I'm using the very popular Elementor theme to build my WordPress site, but unfortunately there is not a Widgets option when I go to Appearance in the Dashboard: I need it in order to create a sidebar....
0
votes
0answers
17 views

How can I create a 'sub-blog' which has its own sidebar on individual posts?

I've created a WordPress site with a blog which has several categories of posts. One category, 'News', is a special one, and should display separately ('News' posts will only ever be tagged as 'News' ...
0
votes
0answers
14 views

Sidebar not displaying (theme development)

I'm developing a theme via an online course and I can't get the sidebar to display. I've used the hook widget_init and the function is being called because I can echo text out. Index.php is correctly ...
0
votes
1answer
83 views

Need to delete the sidebar widget area and have the page a full page rather than just have a blank widget area

A recent post on how to remove the archives and meta from the sidebar answered a question I had and I was successful to have the left side of the page blank. The post was at Can not Remove Archives ...
0
votes
0answers
65 views

How do you insert code into the sidebar?

I would like to add code to the top of the sidebar. When I do: add_action('get_sidebar', 'function') It adds above the sidebar DIV. I would like to insert inside the DIV. If I do: add_action('...
0
votes
0answers
338 views

sidebar in 2020 theme as a widget

I am using the default 2020 theme for my wordpress site which has a static page displayed as the front-end. Now I want a sidebar (right) to display my links (blogroll) and recent posts. Where is the ...
0
votes
1answer
237 views

Force Sidebar on Full Width page

Any WP theme editor php gurus out there? So I'm using a theme that allows me to force all pages to full width. I have over 10,000 pages. It also forces my posts to full width too. I'm pretty sure I ...