وقتی وارد widgets میشوم این پیغام No Sidebars

Widget is a fancy word for tools or content that you can add, arrange, and remove from the sidebar(s) of your website or blog. Widgets make it easy to customize the content of your sidebar(s). If you don’t see your sidebar you may need to add at least one widget. You can learn more about the widgets we offer by checking out the Related links on the right.

To add a widget, watch the video below for a quick overview of how it works, and read below for more examples and settings.

You can access your widgets from the My Sites → Customize. (You’ll see that option to the right of Themes on that menu.)

وقتی وارد widgets میشوم این پیغام No Sidebars

This takes you to the Customizer, where you’ll be able to add and remove and configure widgets for your site.

In your Customizer, click on the Widgets tab. Your theme’s available widget areas will display (and might look a bit different from this):

To add a widget, first click on a widget area. In the panel, click on Add a Widget. The Customizer will show all of the available widgets that you can add.

Scroll the alphabetized list of widgets, or use the search field at the top to find one. Then, click on a widget to add it. The Customizer will then display a box to configure the widget’s settings.

When you’ve finished updating these fields, click Close on the bottom left of the widget box. You can also reopen and update a widget using the small down-facing arrow, or remove it by clicking Delete.

If you have questions about a particular widget, each one has its own support page, which you can find in the Related section on the right side of this page.

↑ Table of Contents ↑

Widgets can be configured to appear only on certain pages (or be hidden on certain pages) by clicking on the Visibility button.

Visibility is controlled by six aspects: page type, category, tag, date, author, and taxonomy. For example, if you wanted the Archives widget to only appear on category archives and error pages, choose “Show” from the first dropdown and then add two rules: “Page is 404 Error Page” and “Category is All Category Pages.”

You can also hide widgets based on the current page. For example, if you don’t want the Archives widget to appear on search results pages, choose “Hide” and “Page is Search Results.”

Each visibility rule is handled separately. There isn’t a way, for example, to only display a widget on posts that are categorized as “Summer” and also tagged with “Picnic.”

↑ Table of Contents ↑

If you would like to remove a widget from the sidebar, click the Delete link in the configuration options as show above.

↑ Table of Contents ↑

If you need a more accessible way to add widgets, go to My Sites → Settings → WP Admin → Appearance → Widgets and toggle Screen Options to turn off the drag and drop feature.

In accessibility mode, you can add widgets to your sidebar using the Add links next to each widget name

and you can modify widgets using the Edit links.

↑ Table of Contents ↑

For those using screen readers and keyboard navigation, these instructions should help you enable Accessibility mode:

When using a keyboard, if you have trouble modifying widgets or encounter any other accessibility issues, please feel free to contact support for more assistance.

↑ Table of Contents ↑

Why are sidebar elements showing up on my blog that aren’t listed under my widgets?

Some older themes offer a set of sidebar elements. For example, the Nuntius theme offers a search bar and an archives list as default sidebar elements. You will notice that when you go to My Sites → Customize → Widgets these elements will NOT appear among your Current Widgets. To remove these sidebar elements, go to My Sites → Customize → Widgets and add one or more widgets to the widget area. This will replace all sidebar elements with the widget(s) of your choice.

↑ Table of Contents ↑

Widgets offer a wide range of ways to add more interest and content to your site. We’ve gathered our best advice and tutorials on how to use widgets.وقتی وارد widgets میشوم این پیغام No Sidebars

Best for students

Best for hobbyists

Best for freelancers

Best for small businesses

Contact support.

We’re always looking to improve our documentation. If this page didn’t answer your question or left you wanting more, let us know! We love hearing your feedback. For support, please use the forums or contact support form. Thanks!

Name

E-Mail

Website

An Automattic Medley

Plugins

This plugin gives every widget an extra control field called “Widget logic” that lets you control the pages that the widget will appear on. The text field lets you use WP’s Conditional Tags, or any general PHP code.

PLEASE NOTE The widget logic you introduce is EVAL’d directly. Anyone who has access to edit widget appearance will have the right to add any code, including malicious and possibly destructive functions. There is an optional filter ‘widget_logic_eval_override’ which you can use to bypass the EVAL with your own code if needed. (See Other Notes).

There is also an option to add a wordpress ‘widget_content’ filter — this lets you tweak any widget’s HTML to suit your theme without editing plugins and core code.

If you like and use Widget Logic you could consider a small donation to Cancer Research UK. I have a JustGiving.com donation link. As of February 2017 we have raised 1,048.50 UKP.وقتی وارد widgets میشوم این پیغام No Sidebars

The text in the ‘Widget logic’ field can be full PHP code and should return ‘true’ when you need the widget to appear. If there is no ‘return’ in the text, an implicit ‘return’ is added to the start and a ‘;’ is added on the end. (This is just to make single statements like is_home() more convenient.)

Make good use of WP’s own conditional tags. You can vary and combine code using:

There are lots of great code examples on the WP forums, and on WP sites across the net. But the WP Codex is also full of good examples to adapt, such as Test if post is in a descendent category.

Note the extra ‘;’ on the end where there is an explicit ‘return’.

Before the Widget Logic code is evaluated for each widget, the text of the Widget Logic code is passed through this filter. If the filter returns a BOOLEAN result, this is used instead to determine if the widget is visible. Return TRUE for visible.

When this option is active (tick the option tickbox at the foot of the widget admin page) you can modify the text displayed by ANY widget from your own theme’s functions.php file. Hook into the filter with:

where [priority] is the optional priority parameter for the add_filter function. The filter function can take a second parameter (if you provde that last parameter ‘2’) like this:

The second parameter ($widget_id) can be used to target specific widgets if needed.

A WordPress filter function ‘takes as input the unmodified data, and returns modified data’ which means that widget_content filters are provided with the raw HTML output by the widget, and you are then free to return something else entirely:

I was motivated to make this filter in order to render all widget titles with the excellent ttftitles plugin like this:

People often ask for a way to give widgets alternating styles. This filter inserts widget_style_a/widget_style_b into the class=”widget …” text usually found in a widget’s main definition:

Aside from logic against your widgets, there are three options added to the foot of the widget admin page (see screenshots).

Add ‘widget_content’ filter — This allows you to modify the text output in all widgets. You need to know how to write a WP filter, though some basics are covered in Other Notes.

Use ‘wp_reset_query’ fix — Many features of WP, as well as the many themes and plugins out there, can mess with the conditional tags, such that is_home is NOT true on the home page. This can often be fixed with a quick wp_reset_query() statement just before the widgets are called, and this option puts that in for you rather than having to resort to code editing

Load logic — This option allows you to set the point in the page load at which your widget logic if first checked. Pre v.50 it was when the ‘wp_head’ trigger happened, ie during the creation of the HTML’s HEAD block. Many themes didn’t call wp_head, which was a problem. From v.50 it happens, by default, as early as possible, which is as soon as the plugin loads. You can now specify these ‘late load’ points (in chronological order):

You may need to delay the load if your logic depends on functions defined, eg in the theme functions.php file. Conversely you may want the load early so that the widget count is calculated correctly, eg to show an alternative layour or content when a sidebar has no widgets.

Don’t cache widget logic results — From v .58 the widget logic code should only execute once, but that might cause unexpected results with some themes, so this option is here to turn that behaviour off. (The truth/false of the code will be evaluated every time the sidebars_widgets filter is called.

Aside from logic against your widgets, there are three options added to the foot of the widget admin page (see screenshots).

Add ‘widget_content’ filter — This allows you to modify the text output in all widgets. You need to know how to write a WP filter, though some basics are covered in Other Notes.

Use ‘wp_reset_query’ fix — Many features of WP, as well as the many themes and plugins out there, can mess with the conditional tags, such that is_home is NOT true on the home page. This can often be fixed with a quick wp_reset_query() statement just before the widgets are called, and this option puts that in for you rather than having to resort to code editing

Load logic — This option allows you to set the point in the page load at which your widget logic if first checked. Pre v.50 it was when the ‘wp_head’ trigger happened, ie during the creation of the HTML’s HEAD block. Many themes didn’t call wp_head, which was a problem. From v.50 it happens, by default, as early as possible, which is as soon as the plugin loads. You can now specify these ‘late load’ points (in chronological order):

You may need to delay the load if your logic depends on functions defined, eg in the theme functions.php file. Conversely you may want the load early so that the widget count is calculated correctly, eg to show an alternative layour or content when a sidebar has no widgets.

Don’t cache widget logic results — From v .58 the widget logic code should only execute once, but that might cause unexpected results with some themes, so this option is here to turn that behaviour off. (The truth/false of the code will be evaluated every time the sidebars_widgets filter is called.

There was an important change to how your Widget Logic code is evaluated. There is a new default ‘Load logic’ point of ‘after query variables set’. For most people this should be better, but you could try reverting to the old default ‘when plugin starts’.

You have a PHP syntax error in one of your widget’s Widget Logic fields. Review them for errors. You might find it easiest to check by using ‘Export options’ and reading the code there (Though be aware that single and double quotes are escaped with multiple backslash characters.)

If you are having trouble finding the syntax error, a simple troubleshooting method is to use ‘Export options’ to keep a copy and then blank each Widget Logic field in turn until the problem goes. Once you’ve identified the problematic code, you can restore the rest with ‘Import options’.

This is often, not always, fixed by trying the different ‘Load Logic’ options. The ‘after query variables set’ option looks like it might be a better default, try it.

Since v .50 the widget logic code runs such that when dynamic_sidebar is called in a theme’s code it will ‘return false’ if no widgets are present. In such cases many themes are coded to put in some default sidebar text in place of widgets, which is what you are seeing.

Your options, if you want this default sidebar content gone, are to either edit the theme, or as a work around, add an empty text widget (no title, no content) to the end of the sidebar’s widget list.

There is some confusion between the Main Page and the front page. If you want a widget on your ‘front page’ whether that is a static page or a set of posts, use is_front_page(). If it is a page using is_page(x) does not work. If your ‘front page’ is a page and not a series of posts, you can still use is_home() to get widgets on that main posts page (as defined in Admin > Settings > Reading).

I believe this is fixed in 5.7.0. Let me know if that is not the case.

If your theme calls the sidebar after the loop you should find that the wp_reset_query option fixes things. This problem is explained on the is_page codex page.

Take care with your conditional tags. There is both an in_category and is_category tag. One is used to tell if the ‘current’ post is IN a category, and the other is used to tell if the page showing IS for that category (same goes for tags etc). What you want is the case when:

which in proper PHP is:

Have a go at it yourself first. Check out the ‘Writing Logic Code’ section under Other Notes.وقتی وارد widgets میشوم این پیغام No Sidebars

This is sort of deliberate. I originally wrote it to be as flexible as possible with the thought of writing a drag’n’drop UI at some point. I never got round to it, because (I’m lazy and) I couldn’t make it both look nice and let you fall back to ‘pure code’ (for the possibilities harder to cater for in a UI).

The plugin Widget Context presents a nice UI and has a neat ‘URL matching’ function too.

It might be that your theme performs custom queries before calling the sidebar. Try the wp_reset_query option.

Alternatively you may have not defined your logic tightly enough. For example when the sidebar is being processed, in_category(‘cheese’) will be true if the last post on an archive page is in the ‘cheese’ category.

“Widget Logic” is open source software. The following people have contributed to this plugin.

“Widget Logic” has been translated into 13 locales. Thank you to the translators for their contributions.

Translate “Widget Logic” into your language.

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

wp_reset_query works better under certain conditions.

The code has been adapted to work on the servers with restricted <?=

Fixed support for the wp_register_sidebar_widget widgets.

Some content was prepared for translation.

Fixed the issue of displaying errors under certain conditions.

Added full support for WP customizer.

In case of a fatal error in logic, the widget will not be displayed.

Fixed the issue when in some cases the plugin displayed user logic errors in the Widgets section and this didn’t allow to save the widgets.
https://wordpress.org/support/topic/an-error-has-occurred-please-reload-the-page-and-try-again-3/

Restored a striplashes that vanished in 0.54 causing much grief.

A little ‘trim’ of WL code to stop “syntax error, unexpected ‘)’” errors, which could occur if your WL was just a single space. Thanks to https://twitter.com/chrisjean for pointing this out.

Translation support! Thanks to Foe Services Labs https://wordpress.org/support/profile/cfoellmann for the work on this and the German Social Translation

Added a ‘widget_logic_eval_override’ filter. This allows advanced users to bypass EVAL with a function of their own.

Accidentally released code with a terrible bug in it 🙁

Two new features: optional delayed loading of logic (see Configuration under Installation), and the ability to save out and reload all your site’s widget logic into a config file

One important bug fix (fairly major and fairly stupid of me too)

For the first time since this started on WP 2.3, I’ve rewritten how the core widget logic function works, so there may be ‘bumps ahead’.

It now uses the ‘sidebars_widgets’ filter (as it should have done when that was
introduced in WP2.8 by the look of it). The upshot is that is_active_sidebar should behave properly.

Widget callbacks only get intercepted if the ‘widget_content’ filter is activated, and much more briefly. (A widget’s ‘callback’ is rewired within the ‘dynamic_sidebar’ function just before the widget is called, by the ‘dynamic_sidebar_param’ filter, and is restored when the callback function is invoked.)

Kill some poor coding practices that throws debug notices – thanks to John James Jacoby.

Fix to work with new WP2.8 admin ajax. With bonus fixes.

simple bug fix (form data was being lost when ‘Cancel’ing widgets)

WP 2.5+ only now. WP’s widget admin has changed so much and I was getting tied up in knots trying to make it work with them both.

Brings WP 2.5 compatibility. I am trying to make it back compatible. If you have trouble using WL with WP 2.1–2.3 let me know the issue. Thanks to Kjetil Flekkoy for reporting and helping to diagnose errors in this version

Translate into your language

Issues resolved in last two months:

0 out of 4

View support forum

Would you like to support the advancement of this plugin?

Donate to this plugin

Code is Poetry.

Many templates come with the pre-defined option to display a sidebar in the website/blog pages. The role of the sidebar is to show information that is not part of the main pages content.

However, you might want to hide the sidebar in the website pages, or simply remove it.

First, let’s see why it is so important to remove a sidebar from WordPress.

Here’s a list of the most common cases when you don’t want a sidebar to appear on your blog/website pages:وقتی وارد widgets میشوم این پیغام No Sidebars

Keep reading to see the methods you can use to remove the sidebar in your WordPress website.

The information contained in the sidebar is organized by widgets.

A WordPress widget is a small area that includes specific types of content. There might be a calendar, or the blog archive, recent comments or a list of your website pages, etc.

Here’s how the sidebar appears on a blog page:

You might want to remove this sidebar from your blog.

It can distract users from the main page content and you don’t want to break the reading flow.

All you have to do is go to the WordPress Admin dashboard and delete the widgets that are part of the sidebar.

You should find this section:

In this case, it’s named “Sidebar widget area”, as shown in the above image.

For this doing, click on the widget section, to expand it.

You’ll see the “Delete” button at the bottom of the widget section, as shown in the image above.

Press “Delete” and that’s it. You have just removed the first widget from the sidebar.

You have to do the same with every widget that is part of the sidebar widget area. In this case, you should also remove “Archives” and “Recent Comments”. You’ll do this by pressing the “Delete” button corresponding to the respective sections.

You should see no more widgets next to the Sidebar Widget Area:

The result will be that the sidebar is no longer displayed in the blog pages:

The featured image and the blog content will occupy the entire space of the screen, as you can see in the above image.وقتی وارد widgets میشوم این پیغام No Sidebars

Another method you can use to remove the sidebar is to apply certain settings to your pages, from the WordPress Admin Dashboard.

It’s very easy to implement, provided you have a theme that supports this functionality.

The result will be that the page/post main content will display on the entire screen, and no sidebar will be placed on the page.

You need to login to your WordPress account. Enter the WordPress Admin Dashboard and select Pages or Posts to check the list of your website pages or your blog posts.

Select the page/post you want to remove the sidebar from.

In the right-hand options, scroll down to attributes.

You should find the options for Template, as indicated in the image below:

Use the drop-down menu and find the option to set the page to Full Width Template.

Select it and press “Update”.

The main content of the page will occupy the entire space of the screen, as you can see below:

If method 2 doesn’t work, it means you’re using a theme that does not support the full width template.

But you still want to remove the sidebar from your website pages.

There’s an additional solution for such a case: edit the source code of the website.

However, it is not recommended that you edit directly the source code in your theme. It might break the website. We suggest you have a child theme and edit the source code for that child theme. For this step, please refer to this guide on creating child themes in WordPress.

Here’s how:

Login to your WordPress account and enter the Admin Dashboard in WordPress.

In the left-hand menu, go to Appearance -> Editor. You’ll find a screen that displays the following:

Find the Sidebar.php file and click on it.

The lines of code to be added to the Sidebar.php file will be as follows:

You need to edit this file and add some extra lines of code, to remove sidebar from your blog posts or website pages.

And to ensure the changes do not break the overall design, the code adjustments should concern commenting the code.

So, you’ll have to add the extra lines indicated below, and press “Update”:

The result will be deletion of the sidebar from your pages:

This method supposes that you’ve been using a plugin for sidebars: Content Aware Sidebar.

With the help of Content Aware Sidebar, you created a sidebar and you set it to display on some or all of the website pages. But you no longer want the sidebar to appear on the pages.

Similarly to the first method, this one requires you identify the section destined to the sidebar you want to eliminate.

In the case below, we want to remove the sidebar including “Archives”, “Calendar” and “Recent Comments”.

Login to your WordPress Admin Dashboard.

Go to Appearance -> Widgets.

The sidebar section we want to apply changes to is named Sidebar for Test. It is marked with a blue line, as are all sidebars created with the Content Aware Sidebar.

You’ll find a green button corresponding to Sidebar for Test. This marks that the sidebar is active on pages.

To remove the sidebar from WordPress, you’ll have to deactivate Sidebar for Test, as you can see in the image below:

After having deactivated the sidebar, it’ll no longer display on the pages:

We hope you’ll find the method that works for you and manage to remove the sidebar from your WordPress website. Therefore, the website design will look neat and clean, and have a modern look that users will appreciate.