Exporting events feed

Home Forums Calendar Products Events Calendar PRO Exporting events feed

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1432177
    Josep
    Participant

    Hi!
    In my page: https://www.pratsdellucanes.cat
    I need to import feed to an app

    In thread:

    Export events feed

    I modified functions.php. After doing this, my feed is:
    http://pratsdellucanes.cat/feed/
    But here, there are only a few number of events. I have a lot of them created in site! Why?

    And the other question is that I need two different feeds. One for posts and other for events. How can I do that?

    Thanks!

    #1433416
    Victor
    Member

    Hi Josep!

    Thanks for reaching out to us! Let me help you with this topic.

    First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.

    That said, we always like helping out and at least point users into the right direction as much possible.

    Could you please share with us the exact same snippet you are using in your functions.php file? I will try to run some tests on my end and see if I can come up with a modified snippet that achieves what you are looking for.

    Thanks,
    Victor

    #1433440
    Josep
    Participant

    Hi!

    The code is:
    `
    // Add Events to RSS Feed
    function add_events_to_rss_feed( $args ) {
    if ( isset( $args[‘feed’] ) && !isset( $args[‘post_type’] ) )
    $args[‘post_type’] = array(‘post’, ‘tribe_events’);
    return $args;
    }

    add_filter( ‘request’, ‘add_events_to_rss_feed’ );

    // Add Tribe Event Namespace
    add_action( ‘rss2_ns’, ‘events_rss2_namespace’ );

    function events_rss2_namespace() {
    echo ‘xmlns:ev=”http://purl.org/rss/2.0/modules/event/”‘.”\n”;
    }

    // Add Event Dates to RSS Feed
    add_action(‘rss_item’,’tribe_rss_feed_add_eventdate’);
    add_action(‘rss2_item’,’tribe_rss_feed_add_eventdate’);
    add_action(‘commentsrss2_item’,’tribe_rss_feed_add_eventdate’);

    function tribe_rss_feed_add_eventdate() {
    if ( ! tribe_is_event() ) return;
    ?>

    <?php }

    add_action( 'pre_get_posts', 'custom_teardown_tribe_order_filter', 60 );

    function custom_teardown_tribe_order_filter() {
    if ( is_feed() ) remove_filter( 'posts_orderby', array( 'Tribe__Events__Query', 'posts_orderby' ), 10, 2 );
    }
    `

    Thanks!

    #1434500
    Victor
    Member

    Hi Josep!

    Thanks for coming back with the code.

    I have now realized that you need two separate feeds for your posts and events. Events have their own feed by navigating to a URL like yoursite.com/feed/?post_type=tribe_events or yoursite.com/events/feed/

    And for your site’s regular posts you can access them at yoursite.com/feed

    Will that work for what you are trying to achieve? Let me know.

    Thanks,
    Victor

    #1434532
    Josep
    Participant

    Great!
    Thank you very much!

    #1435093
    Victor
    Member

    You are welcome Josep! Thanks for following up.

    I’ll close this thread now, but feel free to open a new topic if anything comes up and we’ll be happy to help.

    Cheers,
    Victor

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Exporting events feed’ is closed to new replies.