Widgets are used to display information on different regions of a WordPress website. A WordPress template has different widget areas. Widgets can be dragged and placed by using the Widget Manager accessible through Appearance > Widgets in the admin area. But what happens when you want to choose or limit their display in certain pages?
For example: You want to display certain widgets only in the homepage or the category page and prevent it from displaying in the posts page.
For such detailed configurations, you can use the Widget Visibility module freely available in Jetpack. It allows you to control the widget display to the finest details. You can display ads on a certain page, and the list of top posts on all pages while avoiding the homepage. All you need to do is some simple configurations for the Widget Visibility module.
To access this useful module, list all the features of Jetpack and activate the one that says Widget Visibility. Once activated, you do all the configurations from Appearance > Widgets section of your WordPress admin.
To Configure Widget Visibility for Certain Widgets
- From your Widget Manager (Appearance > Widgets), expand the one that you want to configure.
- Click on the button that says Visibility (present right next to the Save button).
- You can add conditions to show or hide the widget.Examples:
Show if Category is Some Category.
Show if Page is the Front page.
Conditions supported are for page, date, category, author, user, role and tag.
- You can add and remove multiple conditions using the Add and Delete button present on the side.
- Once, you’re satisfied with the visibility settings, click on Save.
After saving, test the display of the widgets on the live website. If you have configured it correctly then they will only display in those pages that you wish to and avoid the pages that you don’t want. You can edit the display configuration by going back to the Widgets page any time from the WordPress admin.
The settings are unique to each individual widget. That means, every single widget item can have certain lines of conditions that specifies the visibility for each of them uniquely.