Modify tribe_get_events to include permalink and category

Home Forums Calendar Products Events Calendar PRO Modify tribe_get_events to include permalink and category

  • This topic has 3 replies, 1 voice, and was last updated 9 years ago by NZIC.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1257633
    NZIC
    Participant

    I have added the following code (from the page Using tribe_get_events) to my template and it works perfectly.

    However, I’d like to modify it and I’m a little stuck. I would like the title to be linked to it’s page. And I would like to be able to apply a category, so that it’s only the “featured” events that display.

    Hoping you can help.

    Thanks,
    Karen

    
    global $post;
     
    $events = tribe_get_events( array(
        'posts_per_page' => 1,
    ) );
     
    foreach ( $events as $post ) {
        setup_postdata( $post );
     
            echo "$post->post_title  ";
            echo tribe_get_start_date( $post );
    #1257822
    Trisha
    Member

    Hi Karen!

    I can help with this! I’ve modified your code a bit to make it easier to add the HTML tags that you need. I also added a taxonomy query that looks for an Events Category called ‘Featured’.

    You can see it here: https://gist.github.com/trishasalas/86cc9975ab65c428dedd6a802dbcf426

    I’d love to hear if it works out for you. If you have any questions feel free to let me know as well.

    Cheers,
    Trisha

    #1268982
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Modify tribe_get_events to include permalink and category’ is closed to new replies.