Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
Last active October 14, 2015 06:33
Show Gist options
  • Save farookibrahim/cb4bfcabe01484923b56 to your computer and use it in GitHub Desktop.
Save farookibrahim/cb4bfcabe01484923b56 to your computer and use it in GitHub Desktop.
Change Ministries Labels in Bethlehem
function custom_ministries_post_type_labels() {
$labels = array(
'name' => _x('Ministries', 'post type general name', 'bethlehem'),
'singular_name' => _x('Ministry', 'post type singular name', 'bethlehem'),
'add_new' => _x('Add New', 'block', 'bethlehem'),
'add_new_item' => __('Add New', 'bethlehem'),
'edit_item' => __('Edit', 'bethlehem'),
'new_item' => __('New', 'bethlehem'),
'all_items' => __('All Ministries', 'bethlehem'),
'view_item' => __('View', 'bethlehem'),
'search_items' => __('Search', 'bethlehem'),
'not_found' => __('No ministries found', 'bethlehem'),
'not_found_in_trash' => __('No ministries found in Trash', 'bethlehem'),
'parent_item_colon' => '',
'menu_name' => 'Ministries'
);
return $labels;
}
add_filter( 'ministries_post_type_labels', 'custom_ministries_post_type_labels' );
function custom_ministries_category_labels() {
$labels = array(
'name' => __( 'Minstries Categories', 'bethlehem' ),
'singular_name' => __( 'Minstries Category', 'bethlehem' ),
);
return $labels;
}
add_filter( 'ministries_category_labels', 'custom_ministries_category_labels' );
function custom_ministries_head () {
?>
<div class="ministries-head">
<h5><?php echo _e( 'Ministries', 'bethlehem' ); ?></h5>
<?php ministries_tab_pane(); ?>
</div>
<?php
}
function custom_init() {
remove_action( 'ministries_before_archive_content','ministries_head', 10 );
add_action( 'ministries_before_archive_content','custom_ministries_head', 10 );
}
add_action('init','custom_init');
if( ! function_exists( 'bethlehem_page_title' ) ) {
/**
* Returns the title of the page
* @since 1.0.0
* @return void
*/
function bethlehem_page_title() {
global $post;
$page_title = '';
if ( is_front_page() && is_home() ) {
// Default homepage
} elseif ( is_front_page() ) {
// static homepage
} elseif ( is_woocommerce_activated() && is_woocommerce() ) {
$page_title = __( 'Shop', 'bethlehem' );
} elseif( is_post_type_archive( 'ministries' ) || is_singular( 'ministries' ) || is_tax( get_object_taxonomies( 'ministries' ) ) ) {
$page_title = __( 'Ministries', 'bethlehem' );
} elseif( is_post_type_archive( 'sermons' ) || is_singular( 'sermons' ) || is_tax( get_object_taxonomies( 'sermons' ) ) ) {
$page_title = __( 'Sermons', 'bethlehem' );
} elseif( is_post_type_archive( 'give_forms' ) || is_singular( 'give_forms' ) || is_tax( get_object_taxonomies( 'give_forms' ) ) ) {
$page_title = __( 'Causes', 'bethlehem' );
} elseif( is_post_type_archive( 'stories' ) || is_singular( 'stories' ) || is_tax( get_object_taxonomies( 'stories' ) ) ) {
$page_title = __( 'Stories', 'bethlehem' );
} elseif( is_post_type_archive( 'team-member' ) || is_singular( 'team-member' ) || is_tax( get_object_taxonomies( 'team-member' ) ) ) {
$page_title = __( 'People', 'bethlehem' );
} elseif( is_events_calendar_activated() && ( tribe_is_event() || tribe_is_event_category() || tribe_is_view() || is_singular( 'tribe_events' ) ) ) {
$page_title = __( 'Events', 'bethlehem' );
} elseif ( is_page() ) {
$page_title = '';
} elseif ( is_home() ) {
$page_title = __( 'Blog', 'bethlehem' );
} elseif ( is_category() ) {
$page_title = __( 'Blog', 'bethlehem' );
} elseif ( is_singular() ) {
$page_title = __( 'Blog', 'bethlehem' );
} else {
//$page_title = $post->post_title;
}
?>
<div class="site-page-title">
<div class="wrap">
<h1><?php echo $page_title; ?></h1>
</div>
</div><!-- /.site-page-title -->
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment