tdevine33
Member
Posted 1 year ago #
I'm trying to display ALL my subcategories, without showing any of their parent categories, but if you add something like 'exclude=22' (22 is parent category) then it won't show any of its children.
For example, I have Category 'Sports' and Category 'Board Games'. Now some sub-categories of 'Sports' would be 'Football' 'Tennis' and 'Baseball' while sub-categories of 'Board Games' would be 'Monopoly' 'Scrabble' etc. How do I go about showing a list that looks something like
-Baseball
-Football
-Monopoly
-Scrabble
-Tennis
ANYONE have any help? It would be greatly appreciated!
tdevine33
Member
Posted 1 year ago #
is there no way to do this? Will I have to display them all separately? like
Sports
-Baseball
-Football
-Tennis
Board Games
-Monopoly
-Scrabble
My client really wants to be able to see ALL sub categories together, NOT separated
tdevine33
Member
Posted 1 year ago #
How about using tags as a way to organize for some of the categories? ANY IDEAS!? If you KNOW that this CANNOT be done, please just tell me!
Thank you to any help that anyone can give it is greatly appreciated.
i don't think this is possible with 'wp_list_categories()'
a possible core structure:
<?php
$all_cats = get_categories();
$all_kitten = array();
foreach( $all_cats as $all_cat ) {
if($all_cat->parent) { $all_kitten[] = $all_cat; }
}
foreach( $all_kitten as $kitten ) { echo $kitten->name.'<br/>'; }
?>
shouldn't be too complex to turn this into some output similar to wp_list_categories() ...
tdevine33
Member
Posted 1 year ago #
so I would have to add this code for each sub-category? so if my client wanted to add 'Lacrosse' to the list, I would have to add into the core structure and it wouldn't be added dynamically when she created a new sub-category?
i have no idea whare this list is for -
is it like a kind of menu?
in the sidebar?
where is it going to show?
you would add this code where-ever your client want to see the list.
the list will be dynamic, i.e. all new sub-categories will be automatically added.
tdevine33
Member
Posted 1 year ago #
This is a left hand sidebar that just lists all categories. Its not actually for sports/board games, its different baby products that are separated into 4 'malls'. The beta site is at
http://www.leapfrogwebmarketing.com/clients/EFB_online/
The way that works now is that there are 4 categories that are Baby Boutique, Everyday Baby, Discount Baby, and Organic Baby. Then all the categories that are down the left hand column are actually tags. I'm trying to figure a way to have all of this done with Categories AND when you click on a mall (ie:Organic Baby) it will only show the organic baby categories on the left hand sidebar