Restaurant

(Difference between revisions)
Jump to: navigation, search
(How to get Menu listing page and course archive pages to look like in BuilderChild-Entree)
m (How to show Course description on Course Term archive pages)
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
[http://ithemes.com/forum/builder-block-restaurant/ Support Forum for Builder Block Restaurant]
+
[http://ithemes.com/forum/forum/94-builder-block-restaurant/ Support Forum for Builder Block Restaurant]
  
 
=How to set up=
 
=How to set up=
Line 97: Line 97:
 
That's it!
 
That's it!
  
= Item 4 =
+
= How to show Course description on Course Term archive pages =
 +
 
 +
[[File:Edit Course ‹ Builder Responsive Test Site — WordPress 2013-02-24 21-18-48.png|800px|thumb|none]]
 +
 
 +
[[File:Appetizers-Builder-Responsive-Test-Site-2013-02-24-21-19-14.jpg|800px|thumb|none]]
 +
 
 +
If you would like to show description on Course Term archive pages like http://sitename.com/course/appetizers/, follow this:
 +
 
 +
Edit wp-content/themes/BuilderChild-Entree/restaurant-course/archive.php or wp-content/themes/BuilderChild-Entree-Pub/restaurant-course/archive.php (depending on whichever is the active theme)
 +
 
 +
Below
 +
 
 +
<pre class="brush: php; gutter: false;">
 +
<h4 class="loop-title">
 +
<?php
 +
the_post();
 +
 
 +
$title = builder_get_tax_term_title();
 +
 
 +
if ( is_paged() )
 +
printf( '%s &ndash; Page %d', $title, get_query_var( 'paged' ) );
 +
else
 +
echo $title;
 +
 
 +
rewind_posts();
 +
?>
 +
</h4>
 +
</pre>
 +
 
 +
add
 +
 
 +
<pre class="brush: php; gutter: false;">
 +
<h5 class="loop-description">
 +
<?php
 +
$terms = get_the_terms( $post->ID, 'restaurant_course' );
 +
 
 +
foreach ($terms as $term) {
 +
  echo $term->description;
 +
}
 +
?>
 +
</h5>
 +
</pre>
 +
 
 +
Then add the following at the end of child theme's style.css (WP dashboard -> Appearance -> Editor):
 +
 
 +
<pre class="brush: css; gutter: false;">
 +
.loop-description {
 +
    font-size: 1.5em;
 +
    margin-bottom: 0.5em;
 +
    margin-left: 0.3em;
 +
}
 +
</pre>

Revision as of 09:59, February 24, 2013

Support Forum for Builder Block Restaurant

Contents

How to set up

  1. Download the Restaurant block plugin from here.
  2. Download the corresponding theme (either Entree or Entree Pub) from Member Panel.

How to enable commenting in single Location entry pages

1. Ensure that the latest version of Builder Blocks plugin is being used. See this to learn how to properly update plugins.

2a. Preferred: Add the following code to your child themes functions.php file

function add_comments_to_location() {
    add_post_type_support( 'restaurant_location', 'comments' );
}

add_action('init', 'add_comments_to_location');

2b. Alternatively, if 2a fails: edit wp-content/plugins/builder-block-restaurant/lib/post-types/2.location.php.

Note: Plugin customizations will be erased during plugin upgrades. So remember to re-do this when you update the plugin.

Change

    'supports'    => array( 'title', 'editor', 'thumbnail', 'excerpt' ),

to

    'supports'    => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),


3. Edit wp-content/themes/BuilderChild-Entree/restaurant-location/single.php.

Change

    <?php //comments_template(); // include comments template ?>

to

    <?php comments_template(); // include comments template ?>

4. Go to My Theme -> Settings -> Comments. Place a tick mark for Locations and Save Settings.

How to get Menu listing page and course archive pages to look like in BuilderChild-Entree

When a Builder child theme other than BuilderChild-Entree is active, it is possible to get the Menu listing page and course archive pages to look like in Entree.

For the sake of this tutorial, we are going to use BuilderChild-Default as our active theme and http://localhost/builder3 as the site URL.

We added 2 menu items in "Appetizers" course and 1 menu item in "Sides". When we http://localhost/builder3/menu/, it looks like:

Menu-Items-My-Test-Site-2011-11-28-11-27-01.png

This Menu listing page uses active theme's archive.php.

Copy the following from BuilderChild-Entree theme directory into BuilderChild-Default directory:

  • template-menu-item-listing.php
  • loop-menu-item-archive.php
  • restaurant-menu-item directory
  • images/bg.jpg (optional - If you want to apply Entree theme's body background image)
  • images/date-bg.png
  • images/price-ribbon-right.png

Create a blank Page titled "Menu" and select "Menu Item Listing" as its Template.

Now when we refresh http://localhost/builder3/menu/, it is going to look like

Menu-Items-My-Test-Site-2011-11-28-11-34-28.jpg

After adding this CSS code at the end of BuilderChild-Default's style.css, http://localhost/builder3/menu/ is going to look like

Menu-Items-My-Test-Site-2011-11-28-11-43-55.jpg

When we click on the hyperlink for any course, let's say "Appetizers", it takes us to http://localhost/builder3/course/appetizers/. This is the taxonomy term page.

It is going to look like

Appetizers-My-Test-Site-2011-11-28-12-32-12.png

This taxonomy term archive page also uses active theme's archive.php by default.

Copy BuilderChild-Entree/restaurant-course to BuilderChild-Default directory and then it will look like.

Appetizers-My-Test-Site-2011-11-28-12-34-59.jpg

That's it!

How to show Course description on Course Term archive pages

Edit Course ‹ Builder Responsive Test Site — WordPress 2013-02-24 21-18-48.png
Appetizers-Builder-Responsive-Test-Site-2013-02-24-21-19-14.jpg

If you would like to show description on Course Term archive pages like http://sitename.com/course/appetizers/, follow this:

Edit wp-content/themes/BuilderChild-Entree/restaurant-course/archive.php or wp-content/themes/BuilderChild-Entree-Pub/restaurant-course/archive.php (depending on whichever is the active theme)

Below

<h4 class="loop-title">
	<?php
		the_post();

		$title = builder_get_tax_term_title();

		if ( is_paged() )
			printf( '%s – Page %d', $title, get_query_var( 'paged' ) );
		else
			echo $title;

		rewind_posts();
	?>
</h4>

add

<h5 class="loop-description">
	<?php
		$terms = get_the_terms( $post->ID, 'restaurant_course' );

		foreach ($terms as $term) {
 		   echo $term->description;
		}
	?>
</h5>

Then add the following at the end of child theme's style.css (WP dashboard -> Appearance -> Editor):

.loop-description {
    font-size: 1.5em;
    margin-bottom: 0.5em;
    margin-left: 0.3em;
}
Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox