Home › Forums › Pure Theme Discussion & Support › Hiding 'special' category for slider images
This topic contains 4 replies, has 2 voices, and was last updated by Nick Truscott 9 years, 1 month ago.
-
AuthorPosts
-
March 4, 2012 at 5:15 am #2693
For the slider images in this site I have created 5 custom images of the required size, and made 5 ‘features’, each one has one of the custom images as the ‘featured image’ (obviously) and each feature has to be assigned to a category (again, obvious, right?) – so as these ‘features’ simply exist to hold the images and the redirect URL, I assigned them to a new category called ‘sliders’. Still OK so far?
BTW, the slider works perfectly, images look great, etc. etc. etc….
Elsewhere in the site I want to use the wp category widget to show a list of post categories (nothing unusual there, right?). However, as you can see here: http://frrme.small-beginnings.net/category/news/videos-press-tv-media/ the category list shows the category called ‘sliders’ which, of course, is of no interest to anyone, doesn’t have text – I don’t want it to have text or do anything or even be available to site visitors.
Any suggestion on how to get around this? or should I just make a text widget instead with links to the categories I want to show?
Cheers
NickMarch 5, 2012 at 10:12 am #2703Well, at present the features post type uses the standard category taxonomy. We have a plugin version of this functionality (in use on churchuna), which has its own taxonomy. This may find its way into the themes.
But ‘utility’ categories are a common niggle when using WordPress. People uses categories to help manage display of content and you often want to hide them from lists, there a few way to do this in code using wp_list_categories(), with the exclude= parameter. This is relatively simple stuff but there are also few of plugins that can do it for you
(totally untested by themeloom though – USE WITH CARE):
http://wordpress.org/extend/plugins/wp-hide-categories/
http://wordpress.org/extend/plugins/easy-categories-management-widget/
..many more in the repositoryMarch 5, 2012 at 10:22 am #2705Cheers Tim,
Any chance you can give me an idiots example of how to customise (presumably in the child functions.php)
wp_list_categories()
to exclude=”123″I really don’t want to add more plugins than I need to (or that the client will ultimately have to look after).
March 5, 2012 at 10:52 am #2708If you don’t use a widget you will need to create a custom sidebar file for your child theme or a custom widget! But the code to create a list of categories is this:
wp_list_categories('orderby=name&exclude=276&title_li=');
where 276 is the cat id.
March 5, 2012 at 10:56 am #2709Thanks Tim
Excellent example of thinking simply too simple.
🙁
Mark this as resolved/closed mate – I wont bother you about it any more!
-
AuthorPosts
You must be logged in to reply to this topic.