Created
November 26, 2012 20:56
-
-
Save jo-snips/4150569 to your computer and use it in GitHub Desktop.
The Events Calendar: Set Event Related Page Titles in Genesis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------------*/ | |
/* Set Post Titles in Genesis | |
/*-----------------------------------------------------------------------------------*/ | |
add_action('genesis_post_title','custom_do_post_title'); | |
function custom_do_post_title() { | |
$tribe_ecp = TribeEvents::instance(); | |
$title = get_the_title(); | |
if ( strlen( $title ) == 0 ) | |
return; | |
if ( tribe_is_month() && !is_tax() ) { //grid view | |
$title = '<h1 class="entry-title">Events Calendar</h1>'; | |
} else if ( tribe_is_month() && is_tax() ) { //category grid view | |
$title = 'Events Calendar: ' . tribe_meta_event_category_name() . '</h1>'; | |
} else if ( tribe_is_event() && !tribe_is_day() && !is_single() && !is_tax() ) { //default list view | |
$title = '<h1 class="entry-title">Events List</h1>'; | |
} else if ( tribe_is_event() && !tribe_is_day() && !is_single() && is_tax() ) { //category list view | |
$title = '<h1 class="entry-title">Events List: ' . tribe_meta_event_category_name() . '</h1>'; | |
} else if ( is_singular() ) { | |
$title = sprintf( '<h1 class="entry-title">%s</h1>', apply_filters( 'genesis_post_title_text', $title ) ); | |
} else { | |
$title = sprintf( '<h2 class="entry-title"><a href="%s" title="%s" rel="bookmark">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), apply_filters( 'genesis_post_title_text', $title ) ); | |
} | |
echo apply_filters('genesis_post_title_output', $title) . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment