Home › Forums › Calendar Products › Events Calendar PRO › Exporting events feed
- This topic has 6 replies, 2 voices, and was last updated 8 years, 3 months ago by
Josep.
-
AuthorPosts
-
January 22, 2018 at 4:11 am #1432177
Josep
ParticipantHi!
In my page: https://www.pratsdellucanes.cat
I need to import feed to an appIn thread:
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!
January 23, 2018 at 6:04 am #1433416Victor
MemberHi 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,
VictorJanuary 23, 2018 at 6:31 am #1433440Josep
ParticipantHi!
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!
January 24, 2018 at 4:37 am #1434500Victor
MemberHi 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_eventsoryoursite.com/events/feed/And for your site’s regular posts you can access them at
yoursite.com/feedWill that work for what you are trying to achieve? Let me know.
Thanks,
VictorJanuary 24, 2018 at 5:25 am #1434532Josep
ParticipantGreat!
Thank you very much!January 24, 2018 at 1:24 pm #1435093Victor
MemberYou 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 -
AuthorPosts
- The topic ‘Exporting events feed’ is closed to new replies.
