Builder Church Block

(Difference between revisions)
Jump to: navigation, search
m
(Added == How to assign a layout to Staff and Sermon archive pages ==)
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]
  
= How to add manual excerpt support for Staff entries =
+
== 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:
 
If you would like to have Excerpt metabox in Staff entry edit screen, add the following in City Church child theme's functions.php:
Line 21: Line 21:
 
Source: http://codex.wordpress.org/Function_Reference/add_post_type_support
 
Source: http://codex.wordpress.org/Function_Reference/add_post_type_support
  
= Entry 2 =
+
== How to assign a layout to Staff and Sermon archive pages ==
  
= Entry 3 =
+
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.
  
= Entry 4 =
+
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:
 +
 
 +
<pre class="brush: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' );
 +
</pre>
 +
 
 +
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:
 +
 
 +
<pre>http://example.com/wp-admin/admin.php?page=layout-editor&editor_tab=layouts&layout=4f30b1482cde8</pre>
 +
 
 +
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:
 +
 
 +
<pre class="brush: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' );
 +
</pre>
 +
 
 +
In the above, change "4f30b1482cde8" to the ID of layout that you wish to assign to Staff archive page.
 +
 
 +
[http://ithemes.com/forum/topic/22220-assigning-a-layout-for-post-page-by-category/page__view__findpost__p__104482 Source].
 +
 
 +
== Entry 3 ==
 +
 
 +
== Entry 4 ==

Revision as of 23:30, February 6, 2012

Builder Church Block Support forum

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.

Entry 3

Entry 4

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox