Widget Logic Plugin
One of the frequent requests I receive from my clients when designing their website is to display unique sidebar content per page. Although you can create custom sidebar and assign it to each page, it causes duplicate of content and makes it harder to sync the widget content as a result. Instead, I recommend you try Widget Logic plugin that lets you control display of widget using WordPress Conditional Tags.
Example Conditional Tags
Only Display if…
For example, you can selectively display testimonials on related pages.
|
|
// Display if visitors are on the main blog page is_home() // Display if visitors on the front/home page is_front_page() // Display if the visitors are on the page called "About Us" is_page("About Us") // Display if the visitor is on pages called "About Us" and "Case Studies" is_page(array("About Us", "Case Studies")) |
Do not display if…
You can also use negation in the conditional tags. For example, you can condition a mini contact form to show up in sidebar on every page except for your Contact page (no need to display two contact forms in one page).
|
|
// Do not display if the visitor is on the page "Contact Us" !is_page("Contact Us") |
Different specification method
You can specify the specific page in different ways.
|
|
// By the page name is_page("Contact Us") // By the page slug is_page('contact-us') // By the page id is_page('52') // Mixing up in array is_page(array("Contact Us", 'contact-us', '52')) |