Post-Specific Widgets
Add page-specific widget areas to templates with a Sidebars: header: <?php /* Template Name: Photos template Sidebars: notes (Photo Notes) */ ... Use these sidebars the normal way: dynamic_sidebar('notes'); At present this only works on Pages.
Add page-specific widget areas to templates with a Sidebars: header:
<?php /* Template Name: Photos template Sidebars: notes (Photo Notes) */ ...
Use these sidebars the normal way:
dynamic_sidebar('notes');
At present this only works on Pages.
Screenshots & previews.
Install the plugin the normal way:
- 01Upload the post-specific-widgets folder to the /wp-content/plugins/ directory.
- 02Activate the plugin through the ‘Plugins’ menu in WordPress
- 03Place Sidebars: code1 (Sidebar Name 1), code2 (Sidebar Name 2) in the header of your template
- 04On the Edit Post page, or from the admin bar on any post, click the ‘Page Widgets’ link to edit sidebar widgets for that page.
The header of each template that has unique sidebars should look like this:
<?php /* Template Name: Photos template Sidebars: notes (Photo Notes) */ ...
This will enable a special sidebar with the code notes and the name Photo Notes . From within that template (or within a file loaded by that template, such as sidebar.php ), add the usual WordPress sidebar code:
dynamic_sidebar('notes');
To add widgets to a given page:
- 05Edit the post or page
- 06If this is a page, set the page’s template to one with sidebars set up as above
- 07Save
- 08The ‘Page Widgets’ meta box will appear. Click the ‘Configure Widgets’ button.