Builder Blocks: Restaurant - Example Customizations

From IThemes Codex
(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 63: Line 63:
  
 
<br />
 
<br />
 
  
 
== Enabling commenting in single location entry pages ==
 
== Enabling commenting in single location entry pages ==
Line 171: Line 170:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
==See also==
 +
 +
*[[Builder_Restaurant_Block:_Customizations|Builder Restaurant Block]]
 +
**[[Builder_Blocks:_Restaurant_-_Example_Customizations|Customization Examples]]
 +
*[[Builder_Church_Block:_Customizations|Builder Church Block]]
 +
**[[Builder_Blocks:_Church_-_Example_Customizations|Customization Examples]]
 +
*[[Builder_Events_Block:_Customizations|Builder Events Block]]
 +
**[[Builder_Blocks:_Events_-_Example_Customizations|Customization Examples]]
 +
*[[Builder_Audio_Block:_Customizations|Builder Audio Block]]
 +
**[[Builder_Blocks:_Audio_-_Example_Customizations|Customization Examples]]
 +
 +
<br />
 +
[[:Builder|← Back to Builder Codex Home]]

Latest revision as of 08:35, July 30, 2013

Contents


Setting up the menu listing page and course archive pages like the Builder Child-Entree demo

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


Enabling 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.


Displaying 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;
}

See also


← Back to Builder Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox