Builder Church Block

(Difference between revisions)
Jump to: navigation, search
(Added == How to assign a layout to Staff and Sermon archive pages ==)
(Added == How to display Staff entries on a custom Page ==)
Line 1: Line 1:
 
[http://ithemes.com/forum/forum/134-builder-block-church/ Builder Church Block Support forum]
 
[http://ithemes.com/forum/forum/134-builder-block-church/ Builder Church Block Support forum]
 +
 +
[[BuilderChild-City-Church]]
  
 
== How to add manual excerpt support for Staff entries ==
 
== How to add manual excerpt support for Staff entries ==
Line 67: Line 69:
 
[http://ithemes.com/forum/topic/22220-assigning-a-layout-for-post-page-by-category/page__view__findpost__p__104482 Source].
 
[http://ithemes.com/forum/topic/22220-assigning-a-layout-for-post-page-by-category/page__view__findpost__p__104482 Source].
  
== Entry 3 ==
+
== 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
 +
 
 +
<pre class="brush:php;">
 +
<?php
 +
/*
 +
Template Name: Staff Listing
 +
*/
 +
?>
 +
</pre>
 +
 
 +
at the top.
 +
 
 +
Remove the comments in:
 +
 
 +
<pre class="brush:php;">
 +
/*
 +
$args = array(
 +
'ignore_sticky_posts' => true,
 +
'post_type' => 'staff',
 +
'posts_per_page' => 3,
 +
'paged' =>  get_query_var( 'paged' ),
 +
);
 +
 +
query_posts( $args );
 +
*/
 +
</pre>
 +
 
 +
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:
 +
 
 +
[[File: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:
 +
 
 +
<pre class="brush: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;
 +
}
 +
 
 +
</pre>
  
 
== Entry 4 ==
 
== Entry 4 ==

Revision as of 02:55, February 8, 2012

Builder Church Block Support forum

BuilderChild-City-Church

Contents

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

Entry 4

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox