Visibility settings: Make your WordPress widgets context-aware

One of the things I like about using WordPress.com is getting an early look at features destined for the self-hosted version, WordPress.org.

For example, today I noticed new ‘visibility’ button on the bottom of each of my widgets. Clicking it expands these filtering options:

Widget visibility settings

Playing with these settings will make any widget you add determine whether it should be shown or hidden based on the page it appears on. For example, you could create a Recent Posts widget that only appears on posts, or a Top Posts & Pages widget that only appears on archive pages.

Now users are able to create rules to show or hide widgets on specific category or tag pages, author pages and date (archive) pages. You can also create rules for generic page types that can affect all static pages, all single posts or narrow down to search results pages, the main posts page, the 404 error pages or any specific page.

It is also possible to combine rules so that a widget could – for example – only appear on a 404 and search pages, or on a few select categories and tags.

This is a simple addition that puts a lot of advanced customisation options in the hands of less technical users.

Some more ideas for context-aware widgets

  • Create About.me, Gravatar, Twitter or Text widgets for each author of a multi-user blog to display on that author’s page.
  • If you are selling something – like a book perhaps – create a tag or category for that item and show a Text, Image or other promo widget that will show on pages with that tag or category.
  • Add a Calendar or Archives widget to your search results page. I don’t generally like these widgets as I think that they take up space and don’t get used very often, but if somebody is searching for content on your blog then they could be helpful.
  • Create a Custom Menu widget to add to pages of specific categories that you have a lot of content for. For example, if your blog is about history and you have a lot of content about the Romans, then you can add a more detailed Roman History menu for readers exploring that category.
  • Add the Top Rated posts widget to your about page – there’s a good chance that potential new readers would be interested in those. Same with the Blog Stats widget.
Advertisements