Last active
December 20, 2015 12:49
-
-
Save afragen/6134427 to your computer and use it in GitHub Desktop.
For The Events Calendar. This will show the event category description below the title. This example only shows in list view.
Place in functions.php
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
<?php | |
add_action( 'tribe_events_after_the_title', 'my_category_description' ); | |
function my_category_description() { | |
global $wp_query; | |
if( !isset( $wp_query->query_vars['post_type'] ) or !isset( $wp_query->query_vars['eventDisplay'] ) or !isset( $wp_query->queried_object ) ) return; | |
if( $wp_query->query_vars['post_type'] === 'tribe_events' or $wp_query->query_vars['post_type'][0] === 'tribe_events' and $wp_query->query_vars['eventDisplay'] === 'upcoming' ) | |
echo '<div style="text-align:center;">' . $wp_query->queried_object->description . '</div>'; | |
} |
Now works for both single and multisite
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to check of $wp_query->queried_object