StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 06-14-2009, 10:17 AM
PogoFan PogoFan is offline
Registered User
Pro Plus Member
 
Join Date: Jun 2009
Location: Somewhere on the right coast.
Posts: 76
Default Can a widget be restricted to one category?

sandbox is http://aquaman.pogowasright.org It's a news site where each category is a news section.

I'm switching site over from geeklog to WP 2.7.1, and haven't figured out if there's a way that a widget can be restricted to one news category. For example, I'd like the news feed widget to only appear on the page when someone is looking at the news category, "Breaches," but not when they look at the home page or other news categories.

Is there a way to do that?
__________________
Destroying good code since 1970.
  #2  
Old 06-14-2009, 10:52 AM
Debra's Avatar
Debra Debra is offline
Community Moderator
 
Join Date: Oct 2009
Location: Ontario, Canada
Posts: 13,365
Default Re: Can a widget be restricted to one category?

try this http://wordpress.org/extend/plugins/widget-logic/
__________________
Fat Cat Designs | "Creativity takes courage." Henri Matisse

Make life easier use FireFox and these Customizing tools: Firebug - Web Developer

New to Genesis? See our Guide for Beginners!

Recommended StudioPress Designer
StudioPress on Facebook
  #3  
Old 06-14-2009, 11:22 AM
PogoFan PogoFan is offline
Registered User
Pro Plus Member
 
Join Date: Jun 2009
Location: Somewhere on the right coast.
Posts: 76
Default Re: Can a widget be restricted to one category?

Interesting plugin. Using the widget interface, I entered the logic code '!is_category(6)' in the logic code field because I only want the widget to appear in cat 6, but what that seems to do is display the widget in all categories except 6. Haven't figured out how to alter the code in widget_logic.php to address that or how to enter the code in the widget.

Aha -- just found the problem. For the benefit of anyone else who might want to use it: ignore the '!' that's in their example in the readme file. To just have the widget show up in one -- and only one -- category, the correct code to enter in the logic code field is 'is_category(6)' (or whatever category you want).

Thanks, Debra.
__________________
Destroying good code since 1970.
  #4  
Old 06-14-2009, 11:32 AM
Debra's Avatar
Debra Debra is offline
Community Moderator
 
Join Date: Oct 2009
Location: Ontario, Canada
Posts: 13,365
Default Re: Can a widget be restricted to one category?

did you put a return on the end

!is_category(6);

and ! means NOT so you are excluding it from cat 6
__________________
Fat Cat Designs | "Creativity takes courage." Henri Matisse

Make life easier use FireFox and these Customizing tools: Firebug - Web Developer

New to Genesis? See our Guide for Beginners!

Recommended StudioPress Designer
StudioPress on Facebook
  #5  
Old 06-14-2009, 11:34 AM
PogoFan PogoFan is offline
Registered User
Pro Plus Member
 
Join Date: Jun 2009
Location: Somewhere on the right coast.
Posts: 76
Default Re: Can a widget be restricted to one category?

Yeah.. found my error before I saw your reply. Thank you.
__________________
Destroying good code since 1970.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
black canvas theme restricted to 6 pages? evelyne General Discussion 2 07-08-2010 09:50 AM
Video Player Site with Restricted Access by Users robin General Discussion 1 10-17-2009 03:12 PM
Restricted Section nation General Discussion 2 07-05-2009 07:38 PM


All times are GMT -5. The time now is 10:27 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.