[wp-hackers] Hide category
Dan Gayle
dangayle at gmail.com
Mon Dec 1 23:14:08 GMT 2008
Actually, that is the method that we use to exclude other categories
from the blog because we use it as a CMS for a more extensive site. It
excludes categories great, content and all.
However, we don't want to exclude the post itself from anything. We
just don't want it to show on the site pages that it belongs to a
certain category.
Love that plugin, by the way. Wish it would have greater functionality
for excluding pages, but ah well.
Thanks,
Dan
On Dec 1, 2008, at 3:07 PM, Paul wrote:
> Dan,
>
> I wrote a little plugin to exclude categories from standard WP
> functions like is_feed, is_front, is_search, etc.
> http://wordpress.org/extend/plugins/simply-exclude/
>
> If you don't want to use the plugin you can setup a simple function
> in your theme's functions.php file
>
> // Used to limit the categories displayed in the Feed.
> function myHomePostsFilter($query)
> {
> if ($query->is_feed)
> $query->set('cat','-1'); // where -1 is the cat ID you want to
> exclude. Also you can put multiple IDs in this second parameter. You
> must include the '-' to negate the cat ID.
>
> return $query;
> }
> add_filter('pre_get_posts','myHomePostsFilter');
>
> P-
>
> On Dec 1, 2008, at 4:40 PM, Dan Gayle wrote:
>
>> We have a custom XML feed coming off of our blog that feeds into
>> Google News, and the method used to select the items to send in the
>> feed is by category, "Google News Feed" .
>>
>> How can we hide the fact that our posts are in that category,
>> without messing up the regular functionality of the post?
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list