Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Last active October 4, 2015 14:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jo-snips/aad337b8f0662d4df1b6 to your computer and use it in GitHub Desktop.
Save jo-snips/aad337b8f0662d4df1b6 to your computer and use it in GitHub Desktop.
The Events Calendar: Conditional Page Titles
<div id="pageHead">
<?php if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page ?>
<h1 class="home">The Main Calendar</h1>
<?php } elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages ?>
<h1 class="home">Calendar Category: <?php echo tribe_meta_event_category_name(); ?></h1>
<?php } elseif( tribe_is_event() && !tribe_is_day() && !is_single() && !is_tax() ) { // The Main Events List ?>
<h1 class="home">Events List</h1>
<?php } elseif( tribe_is_event() && !tribe_is_day() && !is_single() && is_tax() ) { // Category Events List ?>
<h1 class="home">Events List: <?php echo tribe_meta_event_category_name(); ?></h1>
<?php } elseif( tribe_is_event() && is_single() ) { // Single Events ?>
<h1><?php the_title(); ?></h1>
<?php } elseif( tribe_is_day() ) { // Single Event Days ?>
<h1><?php $title = 'Events on: ' . date('F j, Y', strtotime(get_query_var( 'eventDate' ))); ?></h1>
<?php } elseif( tribe_is_venue() ) { // Single Venues ?>
<h1><?php the_title(); ?></h1>
<?php } else { ?>
<h1><?php the_title(); ?></h1>
<?php } ?>
<?php $page_description = get_post_meta($post->ID, "_ttrust_page_description_value", true); ?>
<?php if ($page_description) : ?>
<p><?php echo $page_description; ?></p>
<?php endif; ?>
</div><!--end pageHead -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment