The Events Calendar
[resolved] Display Category of Event (6 posts)

  1. ConTici
    Posted 2 years ago #

    How the dickens do I get the category of an event to display?

    I've tried editing the table.php. See the code below... Thanks. :)

    function display_day( $day, $monthView ) {
    	global $post;
    	$output = '';
    	$posts_per_page = tribe_get_option( 'postsPerPage', 10 );
    	for ( $i = 0; $i < count( $monthView[$day] ); $i++ ) {
    		$post = $monthView[$day][$i];
    		setup_postdata( $post );
    		$eventId	= $post->ID.'-'.$day;
    		$start		= tribe_get_start_date( $post->ID, false, 'U' );
    		$end		= tribe_get_end_date( $post->ID, false, 'U' );
    		$cost		= tribe_get_cost( $post->ID );
    		$category	= tribe_meta_event_category_name( $post->ID );
    		<div id='event_<?php echo $eventId; ?>' <?php post_class('tribe-events-event tribe-events-real-event') ?>>
    			<a href="<?php tribe_event_link(); ?>"><?php the_title(); ?></a><?php echo 'cat' . $category;  ?>


    [ Please do not bump your support thread. It will be deleted. ]

  2. Barry
    Posted 2 years ago #

    Hi ConTici - take a gander at the tribe_meta_event_cats() template tag :-)

  3. ConTici
    Posted 2 years ago #

    Thanks Barry. :)

  4. Rob La Gatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Thanks Barry!

    ConTici: that get you where you need to be? Let us know if not, and we'll follow-up as needed. Otherwise I'm inclined to mark this thread RESOLVED unless you disagree.

  5. ConTici
    Posted 2 years ago #

    Actually to display the categories I followed this tutorial. http://alex.leonard.ie/2011/06/30/wordpress-check-if-post-is-in-custom-taxonomy/

    Thanks guys! :)

  6. Rob La Gatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Oh great...awesome to hear that you're all set. That tutorial looks solid and I'm glad you found a way to make it work.

    As I noted above, I'm going to mark this RESOLVED so it's off our list of unaddressed threads. Please let me know if anyone disagrees or has further questions/issues.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • The Events Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic