Conditionally place a widget in WordPress


This post is only for beginners, may be you already learn how to customize the widget. We have learned [post-display] short code and tricks to place post list on the sidebar , if you miss you those here it is.

Controlling the widget Visibility

Every widget in WordPress blog carry a visibility option, which allow us to place some condition for where it should be or should not be appear

Visibility of Widgets

From the select you can place element such as Category, tag, Page etc for matching the is box condition. It will run all the conditions and make the widget visible/hide only if a single condition is succeed.

For example , we can avoid showing a post widget being placed on front page and can place only with particular category post or in a static page.

Here is our WP Post widget which is only visible in WordPress Category Posts and in Front Page. It also hidden to other Pages, Category posts

Our WordPress Category Post Widget

Optionally you can suggest widgets to match all the condition by ticking Match all condition which will make all the conditions are mandatory for the widget

You can customize all widgets from the https://wordpress.com/customize/<blogaddress&gt;

Published by

Manoj

A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.