Builder Church Block

From IThemes Codex
Revision as of 06:17, April 15, 2013 by Sridhar (Talk | contribs)
Jump to: navigation, search

Builder Church Block Support forum

Contents

Introduction

Originally, Builder's Church Block was designed to work specifically with Gallery Church and City Church Builder child themes, but now each Builder child theme fully integrates with all Builder Church Block features.

Builder Church Block makes it easy to keep your church website updated by adding custom post types for sermon and staff content. After uploading and activating the Builder Church Block to your plugins area, both "Staff" and "Sermon" menus will be added to the WordPress dashboard.

From there, simply add your content and then publish like any other WordPress post or page.

The active Builder child theme goes to work providing the styling of your content.

Source.

How to add manual excerpt support for Staff entries

If you would like to have Excerpt metabox in Staff entry edit screen, add the following in City Church child theme's functions.php:

// =========================================
// = Add Excerpt support to Staff entries =
// =========================================

add_action('init', 'add_excerpt_support_to_staff');

function add_excerpt_support_to_staff() {
	add_post_type_support( 'staff', 'excerpt' );
}
2011-12-08 19-51-06.png
2011-12-08 19-52-28.png
2011-12-08 19-58-07.png

Source: http://codex.wordpress.org/Function_Reference/add_post_type_support

How to add Custom Fields support for Sermon entries

If you would like to have Custom Fields meta box in Sermon entry add/edit screen, add the following in City Church child theme's functions.php:

// ===============================================
// = Add Custom Fields support to Sermon entries =
// ===============================================

add_action('init', 'add_cf_support_to_staff');

function add_cf_support_to_staff() {
	add_post_type_support( 'sermon', 'custom-fields' );
}

How to add regular Category support for Sermon entries

If you would like to have Categories meta box in Sermon entry edit screen, add the following in City Church child theme's functions.php:

// ====================================================
// = Add standard Category support to Sermon entries =
// ====================================================

function wpse6098_init() {
    register_taxonomy_for_object_type( 'category', 'sermon' );
}
add_action( 'init', 'wpse6098_init', 100 ); // 100 so the post type has been registered

How to assign a layout to Staff and Sermon archive pages

At My Theme -> Layouts & Views, currently it is not possible to assign a layout to Staff and Sermon archive pages using the Views feature of Builder. "Archives" view can be used, but this view will apply to all date and category archives, tag archives and author archives unless overridden with more specific views.

It is possible to assign a particular layout (ensure that it has a content module) to both Staff and Sermons archive pages separately by adding code in City Church's functions.php.

To assign a layout to Staff archive page

Add this code at the end of City Church's functions.php:

function custom_filter_staff_layout( $layout_id ) {
    if ( is_post_type_archive('staff') )
            return '4f30b1482cde8';
    
    return $layout_id;
}
add_filter( 'builder_filter_current_layout', 'custom_filter_staff_layout' );

In the above, change "4f30b1482cde8" to the ID of layout that you wish to assign to Staff archive page.

To find the ID for a Layout, go to the Layouts listing, copy the edit link for the desired Layout, paste the link somewhere, and grab the text after the last equal sign. For example, consider the following link:

http://example.com/wp-admin/admin.php?page=layout-editor&editor_tab=layouts&layout=4f30b1482cde8

The Layout's ID for the above is 4f30b1482cde8.

To assign a layout to Sermons archive page

Add this code at the end of City Church's functions.php:

function custom_filter_sermons_layout( $layout_id ) {
    if ( is_post_type_archive('sermon') )
            return '4f30b1482cde8';
    
    return $layout_id;
}
add_filter( 'builder_filter_current_layout', 'custom_filter_sermons_layout' );

In the above, change "4f30b1482cde8" to the ID of layout that you wish to assign to Staff archive page.

Source.

How to assign a layout to a specific category term archive page

As an example, let's say there is a Sermon Category titled "Life", all sermon entries that are categorized under "Life" will appear at http://site.com/sermon/category/life/. This category term archive page uses "Full Width" layout by default (assuming, the Archive view that ships with Builder which sets all archive pages to Full Width layout is not deleted). If you would like apply another layout to this page, add the following code at end of child theme's functions.php:

function custom_filter_life_layout( $layout_id ) {
    if ( is_tax( 'sermon_category', 'life' ) )
            return '4f7a81f021fbc';
    
    return $layout_id;
}
add_filter( 'builder_filter_current_layout', 'custom_filter_life_layout' );

In the above, change "life" to the slug of the particular Sermon category of interest. Also change "4f7a81f021fbc" to the ID of layout that you wish to assign to "Life" sermon category archive page. "custom_filter_life_layout" is just the name of function and it can be changed per your liking.

Ref.: http://codex.wordpress.org/Function_Reference/is_tax

How to assign a layout to Sermon Tag archive page

Example URL of a Sermon Tag archive page is http://localhost/builder3/sermon-tag/church/ where "Church" is a Sermon tag term. By default such archive pages uses Archives view (associated with "Full Width" layout by default at My Theme -> Layouts & Views -> Views).

If you would like to set a layout to Sermon Tag archive pages, add the following code at end of child theme's functions.php:

function custom_filter_sermontagarchive_layout( $layout_id ) {
    if ( is_tax('sermon_tag') )
            return '4e15829c9f4c5';
    
    return $layout_id;
}
add_filter( 'builder_filter_current_layout', 'custom_filter_sermontagarchive_layout' );

In the above, change "4e15829c9f4c5" to the ID of layout that you wish to assign to Sermon Tag archive pages. "custom_filter_sermontagarchive_layout" is just the name of function and it can be changed per your liking.

How to display Staff entries on a custom Page

When BuilderChild-City-Church is the active theme and Builder Church Block plugin is active, a list of Staff entries will automatically be available at yourdomain.com/staff. If you would like the same also to be output on any Page of your choice, follow the instructions below:

1. Copy archive-staff.php in BuilderChild-City-Church as my-staff-listing.php. Edit this file.

Add

<?php
/*
Template Name: Staff Listing
*/
?>

at the top.

Remove the comments in:

/*
	$args = array(
		'ignore_sticky_posts' => true,
		'post_type' => 'staff',
		'posts_per_page' => 3,
		'paged' =>  get_query_var( 'paged' ),
	);
	
	query_posts( $args );
*/

You may want to change the value of posts_per_page to a higher number like 10.

Here is a screenshot after making the above changes:

2012-02-08 13-18-13.png

2. Create a Page (if one doesn't already exist) where you would like to display the list of Staff entries. Leave the content empty. Select "Staff Listing" Template in Page Attributes meta box.

3. Add the following at the end of child theme's style.css:

/* ================= */
/* = Staff Archive = */
/* ================= */
body.page-template-my-staff-listing-php .staff-archive .loop-header {
	height: 40px;
}
body.page-template-my-staff-listing-php .staff-archive .loop-title {
	font-size: 96px;
	line-height: 65px;
	color: #F6f6f6;
	text-shadow: 1px 1px #FFF, 2px 2px #FFF, 3px 3px #FFF, 4px 4px #FAFAFA;
}
body.page-template-my-staff-listing-php .staff {
	display: inline-block;
	width: 33%;
	vertical-align: top;
	position: relative;
	margin-bottom: 0;
}
body.page-template-my-staff-listing-php .staff .archive-staff-inner {
	background: #EEEEEE;
	border: 1px solid #DDDDDD;
	padding: 1em;
	margin: 1em;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}
body.page-template-my-staff-listing-php .staff .archive-staff-inner:hover {
	background: #F6F6F6;
	border: 1px solid #EEEEEE;

}
body.page-template-my-staff-listing-php .staff .entry-header {
	width: 100%;
	max-width: 275px;
	padding: 10px 0 0;
	height: 55px;
	margin: -65px auto 0;
	background: #363636;
	background: rgba(0,0,0,.3);
}
body.page-template-my-staff-listing-php .staff .entry-header .entry-title {
	padding: 0 5px;
	margin: 0;
}
body.page-template-my-staff-listing-php .staff .entry-header .entry-title a {
	color: #EEEEEE;
}
body.page-template-my-staff-listing-php .staff .entry-header .entry-meta {
	border: 0;
	margin: 0 5px;
	color: #BBBBBB;
}
body.page-template-my-staff-listing-php .staff .entry-header .entry-meta a {
	color: #DDDDDD;
}
body.page-template-my-staff-listing-php .staff .entry-image a {
	display: block;
}
body.page-template-my-staff-listing-php .staff img {
	padding: 0;
	margin: 0 auto;
	border: 0;
	width: 100%;
	max-width: 275px;
	display: block;
	height:auto;
	-webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border-radius: 2px;
}

How to replace social media text links in single Staff entry pages with images

Before
After

Add the following at the end of child theme's style.css:

body.single .staff .entry-meta.staff-info li {
    width: 15%;
}

body.single .staff .entry-meta.staff-info li a {
    text-indent: -9999em;
    display: block;
    height: 32px;
}

body.single .staff .entry-meta.staff-info li.email a {
    background: url('http://ithemes.com/builder/misc/social-media-icons/32/email.png') no-repeat;
}

body.single .staff .entry-meta.staff-info li.twitter a {
    background: url('http://ithemes.com/builder/misc/social-media-icons/32/twitter.png') no-repeat;
}


body.single .staff .entry-meta.staff-info li.facebook a {
    background: url('http://ithemes.com/builder/misc/social-media-icons/32/facebook.png') no-repeat;
}

Please save the social media icon images, upload them to your server and use them in the above CSS code.

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox