WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. ConTici
    Member
    Posted 1 year 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;  ?>

    http://wordpress.org/extend/plugins/the-events-calendar/

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

  2. Barry
    Member
    Posted 1 year ago #

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

  3. ConTici
    Member
    Posted 1 year ago #

    Thanks Barry. :)

  4. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year 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. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year 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

About this Topic