Trying to pull in the Events Calendar Pro Cat Name

Home Forums Calendar Products Events Calendar PRO Trying to pull in the Events Calendar Pro Cat Name

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1287314
    Kari Acker
    Participant

    HI, Im running a simple query to show the latest event from the events cal pro plugin. Right now I have it pulling in the link, title and featured image.

    I can not for the life of me figure out how to have it pull in its custom taxonomy associated with that event.

    		<div class="small-12 medium-6 large-4 columns">
    			<?php $events = tribe_get_events( array('posts_per_page' => 1, 'orderby' => 'meta_value', 'order' => 'DESC') );
    				foreach ( $events as $event ) { ?>
    					<p class="home-cat"><?php echo tribe_get_event_cat_slugs( $post_id ) ?></p>
    					<a href="<?php echo tribe_get_event_link( $event->ID ) ?>"><?php echo tribe_event_featured_image( $event->ID, 'home-blog', true ); ?></a>
    					<div class="home-news-content clearfix">
    						<a href="<?php echo tribe_get_event_link( $event->ID ) ?>"><h2><?php echo $event->post_title; ?></h2></a>
    						<p><?php echo $event->post_excerpt; ?></p>
    						<a class="home-read-more" href="<?php echo tribe_get_event_link( $event->ID ) ?>">Read More</a>
    					</div>
    			<?php wp_reset_postdata(); } ?>
    		</div>
    #1287449
    Trisha
    Member

    Hello, Kari!

    Thank you for using The Events Calendar! I can help with this ?

    The easiest way to get the custom taxonomy for an event is to use the WordPress function ‘get_the_terms()’. I added it to your code to test, you can see the results in this gist.

    https://gist.github.com/trishasalas/4b1e2c5084b56c994843672d3a938ce1

    Does this help answer your question? Let me know how it goes!

    Cheers,
    Trisha

    #1287602
    Kari Acker
    Participant

    This worked perfect,

    Thanks for the help.

    #1288153
    Trisha
    Member

    Hi, Kari!

    So glad to hear it! 🙂

    I’m going to close this conversation out, but as always, if you need anything else feel free to reach out! I’m happy to help 🙂

    Cheers,
    Trisha

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Trying to pull in the Events Calendar Pro Cat Name’ is closed to new replies.