Builder Blocks
From IThemes Codex
(Difference between revisions)
(Created page with '=Frequently Asked Questions= ==How can I change the page slug created by the Block plugins?== Builder 3.3 has added the functionality which allows you to override the default pa...') |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | = Introduction = | ||
+ | |||
+ | Builder Blocks are plugins that work in any Builder child theme to provide niche specific functionality and features. | ||
+ | |||
+ | = Video = | ||
+ | |||
+ | {{#ev:vimeo|59948117|640}} | ||
+ | |||
+ | = [[Restaurant|Builder Restaurant Block]] = | ||
+ | = [[Builder Church Block]] = | ||
+ | = [[Builder Events Block]] = | ||
+ | |||
=Frequently Asked Questions= | =Frequently Asked Questions= | ||
Line 10: | Line 22: | ||
* sermon | * sermon | ||
* staff | * staff | ||
+ | ====Function==== | ||
<pre class="brush:php"> | <pre class="brush:php"> | ||
/* | /* | ||
Line 45: | Line 58: | ||
* sermon_tag | * sermon_tag | ||
* staff_positions | * staff_positions | ||
+ | ====Function==== | ||
<pre class="brush:php"> | <pre class="brush:php"> | ||
function custom_change_{current_slug}_slug( $settings ) { | function custom_change_{current_slug}_slug( $settings ) { | ||
Line 53: | Line 67: | ||
add_filter( 'it_custom_taxonomy_{current_slug}_filter_settings', 'custom_change_{current_slug}_slug' ); | add_filter( 'it_custom_taxonomy_{current_slug}_filter_settings', 'custom_change_{current_slug}_slug' ); | ||
</pre> | </pre> | ||
+ | Replace {current_slug} and {new_slug}. |
Latest revision as of 09:01, February 26, 2013
Contents |
Introduction
Builder Blocks are plugins that work in any Builder child theme to provide niche specific functionality and features.
Video
Builder Restaurant Block
Builder Church Block
Builder Events Block
Frequently Asked Questions
How can I change the page slug created by the Block plugins?
Builder 3.3 has added the functionality which allows you to override the default page slugs used by the Builder Blocks. These functions need to be added at the end of the child themes functions.php
, before the closing ?> (if any).
Function to change the page slug for the custom post types
Builder Block Restaurant uses the following Custom Post Types
- restaurant_menu_item
- restaurant_location
Builder Block Church uses the following Custom Post Types
- sermon
- staff
Function
/* * Change the Slug from "{current_slug}" to "{new-slug}" * */ function custom_change_{current_slug}_slug( $settings ) { $settings['rewrite']['slug'] = '{new-slug}'; return $settings; } add_filter( 'it_custom_post_type_{current_slug}_filter_settings', 'custom_change_{current_slug}_slug' );
Note, replace {current_slug} and {new_slug}, example:
/* * Change the Slug from "staff" to "members" * */ function custom_change_staff_slug( $settings ) { $settings['rewrite']['slug'] = 'members'; return $settings; } add_filter( 'it_custom_post_type_staff_filter_settings', 'custom_change_staff_slug' );
Function to change the page slug for taxonomies
Builder Block Restaurant uses the following Taxonomies
- restaurant_feature
- restaurant_cuisine
- restaurant_course
- restaurant_allergy
Builder Block Church uses the following Taxonomies
- sermon_category
- sermon_tag
- staff_positions
Function
function custom_change_{current_slug}_slug( $settings ) { $settings['rewrite']['slug'] = '{new_slug}'; return $settings; } add_filter( 'it_custom_taxonomy_{current_slug}_filter_settings', 'custom_change_{current_slug}_slug' );
Replace {current_slug} and {new_slug}.