Widget Contexts Plugin For WordPress

The Widget Contexts plugin for WordPress lets you precisely select which widgets are displayed depending on the page that is being visited.

Available Contexts

  • Front Page — Applies to your site's front page.
  • Blog on a Static Page — Applies to your blog page, in the event it is not your site's front page.
  • Post — Applies to blog posts when they're browsed individual.
  • Attachment — Applies to attachments, e.g. images when browsing a gallery.
  • Category Archives — Applies to category archive pages.
  • Tag Archives — Applies to tag archive pages.
  • Author Archives — Applies to author archive pages.
  • Date Archive — Applies to date archive pages.
  • Name of Section — Applies to that static page, and all of its children.
  • New Section — Applies to newly created sections, i.e. new static pages with no parent.
  • Name of Template — Applies to static pages that use that template (overrides the section's context if any).
  • Search Results — Applies to search results.
  • Not Found Error (404) — Applies to 404 error pages.

The Special template

The Semiologic theme's special template, which does nothing, was introduced to work with Widget Contexts and Silo Widgets.

Typically, it is applied to "stub" pages (static pages that merely contain a Silo Stub widget, which lists that page's child pages, such as this site's software section). It comes in handy if you wish these stub pages to have a different set of widgets from leaf pages (which contain your meaty articles).

If that is what you wish to achieve, proceed as follows:

  1. Create your section, and its subsections if applicable.
  2. Assign the Special template to each of them.
  3. Create the articles that go within it.

Then, configure widgets' contexts:

  1. Use the Special template's context to configure how your stub pages should display.
  2. Use that section's context to configure how its articles should display.

If, for any reasons, you need more than one special template, create a copy of the theme's special.php file. Edit it using a text editor (such as NotePad), and change the template's name. Upload it to your theme's folder, and WordPress will detect it automatically.

Another place where the Special Template can come in handy is if you organize your site as follows:

  • / — The front page.
  • /blog/ — The blog page, with your posts.
  • /blog/archives/ — An archive page.

Archives and Semiologic SEO

When using the Semiologic theme and Semiologic SEO plugin together, some or all of your archives-related contexts will become irrelevant in the "Each Entry" panel. If you wish to have full control of these archive pages, configure them to display excerpts instead of lists of post titles, under Settings / SEO.

Download

This package is part of Semiologic Pro, and is access-restricted.

Bleeding Edge Zip

Frequently Asked Questions

HELP ME!!!

The Semiologic forum is the best place to report issues.

I need a context for this specific category!

It's not implemented, for three reasons:

First and foremost, the odds are you should be using static pages for what you're doing.

Second, the odds are you're also using one of /%postname%/ or /%category%/%postname%/ permalink structure, as recommended in a random "SEO tips" post. The truth is, those two permalink structures can have a severe performance impact on your site — I've seen it bring a bi-Xeon server with moderate traffic to a crawl.

Last, but not least, doing so would introduce performance problems in the WP Widgets UI .

Change Log

Version 2.3.1

  • Further tweaks around the widget context caching

Version 2.3

  • Fix issue where widgets were assigned to new pages even if the New Sections setting was off.
  • Improved context caching to work better with page revisions and auto-saves.
  • Fixed font in Customize Headings due to WP 3.8 admin changes
  • WP 3.8 compat

Version 2.2

  • WP 3.6 compat
  • PHP 5.4 compat

Version 2.1.2

  • Fix svn versioning issue

Version 2.1.1

  • Correct unknown index warnings

Version 2.1

  • WP 3.5 compat
  • Recoded for removed _get_post_ancestors function
  • Fixed section toggles in customize to uncheck all. Requires use of .prop instead of .attr with jQuery 1.6+

Version 2.0.4

  • Change unexpected behavior (page sections vs page template).

Version 2.0.3

  • WP 3.0 compat

Version 2.0.2

  • Cache improvements

Version 2.0.1

  • WP 2.9 compat

Version 2.0

  • Complete Rewrite
  • Localization
  • Code enhancements and optimizations
  • Use WP_Widgets