Skip to content

Instantly share code, notes, and snippets.

@afragen
Last active December 20, 2015 12:49
Show Gist options
  • Save afragen/6134427 to your computer and use it in GitHub Desktop.
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
<?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>';
}
@afragen
Copy link
Author

afragen commented Aug 1, 2013

Updated to check of $wp_query->queried_object

@afragen
Copy link
Author

afragen commented Aug 3, 2013

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