WPPizza – A Restaurant Plugin for WordPress › Support › Faq’s WPPizza v2.x (read only)
(for WPPizza FAQ’s v3.x go here) › single wppizza menu items display
- AuthorPosts
- 29 October, 2014 at 9:18 am #5893
if you did
- NOT enable “Include wppizza menu items in regular search results” (wppizza->settings),
- are NOT using the wppizza search widget (selectable in the wppizza widget)
- or – if using the search widget – have NOT enabled “wppizza menu items” in the widget
- have NOT edited the templates to link to single menu items
- and are NOT using a sitemap generation plugin that automatically indexes single posts/menu items (or are excluding those single menu items from the sitemap)
the following is irrelevant.
however, if any of the above is true, please read on with regards to the “how to display single wppizza menu items” settings/template/page to use in wppizza->settings->Include wppizza menu items in regular search results .
assuming you are including wppizza menu items in your search results for example, you will get a list of results with links (typically the title, but it depends on the theme you are using) to that particular menu item alongside excerpts/content amd/or an associated featured image.
clicking on said link will display the single menu item in its own page according to how your theme’s templates display normal blogpostsif you would like this single item to display like all your other wppizza menu items, there are two choices:
preferred (and really the right way to do this when working with wordpress)
– set/leave the selected option in “wppizza->settings->Include wppizza menu items in regular search results” at “default or custom template [single-wppizza.php if exists]” – your theme has (should have) a file called single.php
– make a copy of this file in the same directory, renaming it to single-wppizza.php
– this file is likely to have something like the following (between some coding like “while ( have_posts() ) : the_post(); …. endwhile “):get_template_part( 'content', get_post_format() );
or similar
REPLACE this bit of coding (leaving the while/endwhile intact) with :
if ($template_file = locate_template( array ('wppizza-loop.php' ))){ include_once($template_file); }else{ include_once(''.WPPIZZA_PATH.'templates/wppizza-loop.php'); }
and your single menu items should now display as any other menu item
(if you are using the responsive style – “wppizza->layout->Which style to use” – use wppizza-loop-responsive.php instead of wppizza-loop.php in the code above )in short:
- make sure option is set to “default or custom template [single-wppizza.php if exists]”
- copy your single.php as single-wppizza.php
- edit/replace the loop code in that single-wppizza.php file as described above
- save
additionally , you could of course make any other edits to that file (like removing comment templates if added by your theme etc ) as you wish
alternative (in case you are not able to or are comfortable with editing/copying theme templates)
set a page you want to use from the dropdown list of pages provided (still talking about wppizza->settings->Include wppizza menu items in regular search results : “how to display single wppizza menu items”)this in turn will “hijack” this page and it’s contents when displaying single wppizza menu items while keeping any other formatting, sidebars etc you are using for your pages
however, the chances are / caveat is , that your theme will probably still display at least the page title somewhere, so this really is just an added option on not really the way this sort of thing should be done with wordpress
you can of course also create a new, empty page and use that one (the above still aplies though and you would probably / via a plugin or some such, want to exclude this page from your normal wordpress page menu as it would be blank if it does not display a single menu item coming from a link of a search result)
as ever, if you have any questions or need help with this, leave a message in the support forum here or on wp-pizza.com
- AuthorPosts
- The topic ‘single wppizza menu items display’ is closed to new replies.