WPPizza – A Restaurant Plugin for WordPress › Support › General Support › how to work with parent categories?
- AuthorPosts
- 15 May, 2015 at 10:41 am #9908
Hi,
i try to figure out how to print parent categories.
using “navigation Shortcode” it cant be done. if there is any other way to exclude all subcategories and print only parent categories?2. how possible to show all subcategories with all the items when clicked on the parent category?
for example i want to create 3 menus
pizza
meat
alcoholi created category pizza, meat, alcohol. then i have created subcategories for each parent category.
now i want to show to user all the subcategories and all the items based on category.
* bug the i have found in “wppizza-loop.php”
<?php if(!is_single() && !isset($noheader) && $termDetails && $the_query->found_posts>0){ /*exclude header if set or is single or <=0 posts */?>
here you check if there is posts in category, if so, you print the category.
the problem here is when i create parent category without any items, but this parent category have subcategories with items you still print this parent category.i think you need to exclude all parents categories if they have only subcategories.
15 May, 2015 at 4:30 pm #9925Olly?
15 May, 2015 at 4:42 pm #9926>if there is any other way to exclude all subcategories and print only parent categories…etc etc
it’s a normal custom post type, do as you please (or go to appearance -> menu and just do one of those selecting the categories you want.)
>bug the i have found in “wppizza-loop.php”…
how is that a bug ? it does do what it is supposed to be doing. only that *you* want it to do something else. in any event, it’s a template, so if you want to it to do different things, feel free to edit as required…
15 May, 2015 at 5:25 pm #9927there are also some comments in templates/navigation.php maybe those will help . dunno. all depends on your setup and what exactly it is you need to do
17 May, 2015 at 1:26 pm #9963Hi
if there is any way to use ids and not names in the wppizza category shortcode?[wppizza category=’pizza,pasta’]
will be
[wppizza category=’12,14′]
i am using the same category name for the “lunch menu” and regular menu, in this case it not working.
Thanks
17 May, 2015 at 10:45 pm #9968>if there is any way to use ids and not names
it’s not names, it’s slugs (which are as unique as id’s) - AuthorPosts
- The topic ‘how to work with parent categories?’ is closed to new replies.