WPPizza – A Restaurant Plugin for WordPress › Support › General Support › show all items from all categories in one page
- AuthorPosts
- 2 October, 2014 at 3:21 pm #5412
Hi,
first it’s a great plugin! great job!
we also going to but some add-ons after will make some tests in our site to see that all works as we need.
i working on “one page template”.
my question is:
1. how to print all menu items from all the categories? the sort code print only from one category and i need from all like:
category name:
all menu itemscategory name2:
all menu itemsetc….
2. how to use categories navigation without reloading the page?
i mean when i click on “pizza” it will show all the items from pizza category without reloading the page.Thanks!
2 October, 2014 at 3:28 pm #5414>1 how to print all menu items…
just put multiple shortcodes on the page
>2. how to use categories navigation without reloading the page?
you’ll need to write some script that does that
alternatively, put all the shortcodes on their own distinct pages and use/find a theme that loads all pages in one go and then just shows/hides whenever the appropriate link is clicked.
i know there are some / have seen some , but off the top off my head i don’t know which one2 October, 2014 at 4:29 pm #5415Hi,
about the 1
i want to make this dynamically.
because i don’t want to remember to insert every time shortcode when i or some of our employee will create new category.
there is some filter or loop to change that?about the 2.
i can write script but how can i change the categories slug to be only #cat name?Thanks!
2 October, 2014 at 5:09 pm #5416>there is some filter or loop to change that?
I might be wrong of course, but it sounds to me like you are using option 1 here
https://wordpress.org/plugins/wppizza/installation/
when you might want to consider option 2 perhaps (although this in turn might not suit your scenario. dunno . all depends on how you want to put things together)having said that – and thinking out loud for a bit – i suppose i could add/amend the shortcode attributes to automatically show all categories which is actually not a bad idea to start off with really to have that option….
>re2:
you will *always* need a parent of some sort (assuming that i understand you correctly)
this is not down to the plugin, but down to wordpress
again, depending on how it’s setup:the parent can be whatever you like though.
so this will work:
http://www.domain.com/somepagenameslug/pizzas
http://www.domain.com/somepagenameslug/pasta
etcthis:
http://www.domain.com/pizzas
http://www.domain.com/pasta
etc
WILL ONLY WORK IF you create those pages (i.e pizza and pasta) and then put the relevant shortcode on it
(of course in this case you will have to add new pages whenever you create a new category, so it presumably is not an option for you and i’m just saying this here for completeness sake)i don’t understand the following though (I’m probably missing something):
>to be only #cat name..
the category slug IS the cat name…(unless of course you changed the slug), no ?2 October, 2014 at 5:34 pm #5417Hi,
i will explain myself better and give you some examples.
i want to try two scenarios,
the first one is to show all our menu in one page. so no matter how many categories i will create and items it will print all of them in one place.
the example is:
cat1
menu items for this cat
cat2
menu items for this cat
cat3
menu items for this cat
and etc…the second scenario is to show one category by default, and the others categories will be shown based on filter (based on what user will select).
here is a good example:
http://demo.cookpress.ru/
go down until you will find “Menu of the day” (the menu link seems not working so you will see the menu there when you will scroll down).2 October, 2014 at 7:05 pm #5418although you could mess around with the arguments in the ‘wppizza_filter_loop’ filter, it won’t loop over that page to show you all the headers (i.e. category names) all it would/could do is to show *all* items on one page. so this will only partially be helpful.
(essentially you’d be changing the query , but that doesn’t affect the header)easiest thing to do – and i wanted to do that for a while anyway but never got round to it – is for me to add the possibility of a shortcode that allows all categories to be displayed , so you dont have to think about it again. might take a couple of days though, depending on what else crops up.
while I’m at it, I might as well also add a class to the headers and articles that references the selected category – probably by id as the navigation has this already as id’s – which should help you in the second scenario when you need to show/hide things
although the navigation widget/shortcode was only meant to be used if you use templates, it should work in your scenario too…..(with a bit of creative js, showing/hiding things depending on class/id)
2 October, 2014 at 7:58 pm #5419Hi,
that will be awesome!
Thanks you!
when you will add this things i can do the rest with js.2 October, 2014 at 8:34 pm #5420no worries.
will be fun (and probably useful to others too)
might aven be able to do this by tomorrow (unless unforeseen things crop up), but allow me a few daysi’ll keep you posted (there might be a couple of things you might have to be aware of…will let you know)
6 October, 2014 at 10:22 pm #5473just an update.
haven’t forgotten. just came across a couple of other things that would benefit from being looked at.another couple of days.
(actually making this work is easy, coding it so i don’t break possible customisations of this is the bit that needs to be considered/checked)8 October, 2014 at 1:25 pm #5475in v2.11.2 you now have a number of additional shortcodes to play with
see here: https://wordpress.org/plugins/wppizza/faq/ – > what are the available shortcodes
i have also added a bunch of classes and id’s to the article and header elements.
i.e an article has something like this “wppizza-article-special-offers-16”, where the last integer is the category id , whereas the bit before the id and after wppizza-article- bit is the category slug (so in this case “special-offers”). you’ll probably get the rest from hereone note though: as people might have customised their css using direct selectors somewhere, i cannot hardcode a wrapper div around this , however, there are a couple of filters you can use to add this like so (add the below to your themes functions.php:
/*************** wrap loop in div with category id added to classname ************/ add_action('wppizza_loop_outside_start', 'le879_wrap_loop_start',10,4); function le879_wrap_loop_start( $the_query, $options, $termSlug, $categoryId) { if($the_query->found_posts>0){/*only add div if >0 posts*/ print"<div class='some-prefix-".$categoryId."'>";/*or use the termslug or whatever*/ } } add_action('wppizza_loop_outside_end', 'le879_wrap_loop_end',10,1); function le879_wrap_loop_end($the_query) { if($the_query->found_posts>0){/*only add div if >0 posts*/ print"</div>"; } }
i figure you can work it out from here, but if you have questions just shout
8 October, 2014 at 7:59 pm #5477Hi,
i want to say some good word, thank you very much! for your great work and support for this great plugin.
secend, i definitely will buy some add-ons after i will finish with the test.9 October, 2014 at 9:52 pm #5486Hi,
i have noticed one problem.
you dont hide category title and description of category if category dont have menu item when you print all categories.
just add if category dont have menu item – dont print category title and description.Thanks
9 October, 2014 at 10:10 pm #5487>just add if category dont have menu item
not quite *that* simple (but i do remember thinking about – and then forgetting it)
will do . thanks for reminding me9 October, 2014 at 11:57 pm #5492then again, sometimes it is actually quite easy. try v2.11.2.1
(i also edited the filters above to account for that if you need to)
- AuthorPosts
- The topic ‘show all items from all categories in one page’ is closed to new replies.