Selective widget displaying
-
Does anyone know how to have certain widgets appear only on pages you want them to as opposed to every single page?
Thanks,
Steve
-
widget logic plugin
Great thank you–Do you know how to simply insert a conditional tag so you can have a widget appear in all pages EXCEPT said page as opposed to havin got list every single page which could take quite a while…??
Thanks again for your help!
if ( is_page('Foo') ) dynamic_sidebar( 'bar' );?>Awesome thank you— what does ‘bar’ equal–the official name of the wiget?
i assume ‘foo’ should be replaced with the page that i dont want the bar to appear in?
also–do I include ;?> within the tag
‘bar’ = the id of the widget
‘Foo’ = the page nameAnd yes – you need the
?>tag.How do I find the id of the widget?
If you use the widget logic plugin then you can do
!is_page(pagename);The ! means ‘NOT’ you see.
thanks.
so I typed in !is_page(forum);
and instead of erasing it from that page I get: Parse error: syntax error, unexpected ‘;’ in /home7/photofly/public_html/photoflymembers/wp-content/plugins/widget-logic/widget_logic.php(161) : eval()’d code on line 1
Any ideas?
Ugh, sorry, take out the ; at the end 🙂 My bad, I was thinking code and not logic.
My Bad.
awesome!!! thank you
what do I type now if I want to have it removed on other pages as well?
thanks again
ONE more question!
Now that the widgets are gone there is this extra space in the side bar where they used to be….any idea how to get rid of that and move it over
my guess is its in one of the CSS style sheets somewhere and I would need to edit it out for that specific page??
what do I type now if I want to have it removed on other pages as well?
If you want it off ALL pages, use
!is_page()If you want it off selected pages, it’s
!is_page( array('page1','page2','page3') )Now that the widgets are gone there is this extra space in the side bar where they used to be….any idea how to get rid of that and move it over
Again, depends on how you want the sidebars gone. If it’s ALL pages, you can make a page.php templte file for all pages and omit the sidebar. If it’s SPECIFIC pages, you can do similar with page templates.
awesome—thanks a lot!
The topic ‘Selective widget displaying’ is closed to new replies.