-
-
Save jo-snips/aad337b8f0662d4df1b6 to your computer and use it in GitHub Desktop.
The Events Calendar: Conditional Page Titles
This file contains 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
<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