Widgets on Wordpress - how to exclude them on specific pages?

by ak2000
6 replies
  • WEB DESIGN
  • |
Hi, is there a way to prevent a widget appearing on specific pages of a WP site?
(instead of all pages)

Thank you!
#exclude #pages #specific #widgets #wordpress
  • Profile picture of the author Istvan Horvath
    Yes. There is a plugin called Widget Logic.

    Although, you can do the same manually, if you are familiar with the conditional tags in WP.
    Signature

    {{ DiscussionBoard.errors[3716608].message }}
  • Profile picture of the author Evan-M
    Signature

    Evan-M

    Easily The Worlds Best Wordpress Popup plugin

    Visit Website Design Firm For All Your Wordpress Coding Needs

    {{ DiscussionBoard.errors[3716677].message }}
  • Profile picture of the author haymanpl
    There's a few plugins that do that if you don't understand conditional tags
    {{ DiscussionBoard.errors[3716760].message }}
  • Profile picture of the author shariffdotorg
    Widget logic will be a very handy plugin I use in all of my blog.. if you want to display only page then just use this tag is_page() and not to show in page then use this tag !is_page()

    if you home page is default then use is_home() if your home page is a static page not a blog then use is_front()

    You can always try different variants and enjoy learning more.. just experiment it.

    Imran Shariff
    {{ DiscussionBoard.errors[3716780].message }}
  • Profile picture of the author dassad
    If your widget is added dinamically from the admin dashboard than use a plugin, if you implemented the widget from the source code than use Wordpress conditional tags.

    For example:

    if ( is_page('contact')) {
    WIDGET CODE HERE
    }

    the 'contact' can be modified to page id in is_page(ID) format, to page title is_page('Contact'), to page slug in is_page('contact-page') format, to or to check any page then is_page() You can't exclude specific pages this way only print witdget to specific pages. More info here

    Regards,
    daSSad
    {{ DiscussionBoard.errors[3716799].message }}
  • Profile picture of the author ak2000
    Superb, thank you very much everyone - I just implemented it and it worked wonders!
    {{ DiscussionBoard.errors[3725835].message }}

Trending Topics