Event saved like article

Home Forums Calendar Products Events Calendar PRO Event saved like article

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #936158
    Sabrina
    Participant

    Hi,
    I just install your beautiful plugin.

    I’d like that when I edit and save an event, some data like title, description and image feature will be saved like a new article in a specific category.
    So that I can use this data in other page of my site on a specific theme.

    Thanks
    Sabrina

    #936232
    Geoff
    Member

    Hi there, Sabrina! Welcome to the forum and thanks for telling us the plugin is beautiful–we’re super stoked you like it so far. 🙂

    The good news is that events are saved just like posts. In fact, they are registered as a custom post type and function much the same way as default WordPress posts.

    That means you can query Events just like Posts using the <i>get_posts()</i>. That might looks something like this:

    <?php
    $args = array(
    'post_type' => 'tribe-events',
    'posts_per_page' => '5',
    'exclude' => array( $post->ID )
    );
    
    // get posts
    $posts = get_posts( $args );
    
    // check if any posts are returned
    if ( $posts ) { ?>

    Then, you can run your loop to get the data you want, such as the title, start date, end date, description, thumbnail or anything else you need in there. Here’s our entire list of functions to help you find the variables you’re looking for.

    Please let me know if this helps answer your question. 🙂

    Cheers!
    Geoff

    #936255
    Sabrina
    Participant

    This reply is private.

    #936271
    Geoff
    Member

    Hi Sabrina and thanks for following up and helping clarify what you’re looking for. There’s a bit of a language barrier here, but hopefully we can figure this thing out together. 🙂

    If I’m understanding correctly (and I hope I am!), you have two post types (Posts and Events) and would like to display them together on the homepage. Is that correct?

    If so, there is an option under Events > Settings that will make this happen. It will likely be different in your language, but the option is “Include events in main blog loop” (screenshot). If you select that and save your settings, then Posts and Events will both display together on your homepage as long as it is using the main blog loop.

    The second thing I hear you mentioning is preventing recurring events from displaying multiple times. There is another option for that in Events > Settings called “Recurring event instances” (screenshot). Select that option and save your settings and then only the first instance of a recurring event will display in your feed.

    I hope this helps and does a better job of answering your question! Please let know if this is closer to what you’re looking for or if I’m still missing the mark.

    Cheers!
    Geoff

    #936641
    Sabrina
    Participant

    This reply is private.

    #936726
    Geoff
    Member

    Hey there, Sabrina! Thanks for following up and sharing your code–that’s helpful.

    We are unable to support custom development questions here in the forums, but off the bat, I think you will want to check out your content.php file since it contains the content being called and make sure it is properly calling events content that can be displayed. That would be my first stop.

    You may also be interested in this post and this thread which show examples of how others used WP_Query to call events. You may also be interested in our tutorial on how to use tribe_get_events() as an alternative.

    Cheers!
    Geoff

    #937081
    Sabrina
    Participant

    This reply is private.

    #937580
    Geoff
    Member

    Nice catch and good work! I’m glad that did the trick. 🙂

    I’ll go ahead and close this thread but please feel free to start a new one if anything else comes up and we’d be happy to help.

    Cheers!
    Geoff

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Event saved like article’ is closed to new replies.