Home › Forums › Calendar Products › Events Calendar PRO › RSS Feed of events filtered by organizer
- This topic has 4 replies, 3 voices, and was last updated 7 years, 4 months ago by Matt.
-
AuthorPosts
-
January 17, 2017 at 8:57 am #1219671MattParticipant
Hi,
I’ve Been using the event feeds to display on other sites such as : [site url]/category/[category]/feed/
which outputs a useful feed of events filtered by categoryI was hoping when I upgraded to PRO I would get the same for organizers ([your-site]/organizer/[organizer-name]/feed) but it doesn’t seem to work and I can’t find any documentation on it online.
Can anyone let me know how it could be filtered into a feed?
January 18, 2017 at 11:12 am #1220352NicoMemberHowdy Matt,
Welcome to our support forums and thanks for reaching out to us. I can help you on this!
What you describe seems to be true, and there’s no feed output for the organizer page. But there’s a workaround to basically change the query arguments in case there’s a query string indicating the organizer ID.
For this you’ll need to paste the snippet below in your theme’s (or child theme’s) functions.php file:
/* Tribe, get feed by organizer ID */
function tribe_alter_feed ( $query ) {if ( !is_feed() || !tribe_is_event_query() ) return;
// set organizer if passed
if ( isset ($_REQUEST['tribe_organizer']) ) $query->set('tribe_organizer', (int)$_REQUEST['tribe_organizer']);}
add_action( 'pre_get_posts', 'tribe_alter_feed' );
This appending an organizer parameter to the URL [site url]/events/feed/?tribe_organizer=16 the change will be triggered.
Please let me know if this works (bear in mind feeds have a strong cache in WP),
Best,
NicoJanuary 19, 2017 at 2:31 am #1220837MattParticipantThats perfect!
Thanks very much for your help.
CheersJanuary 19, 2017 at 6:47 am #1220900NicoMemberThanks for the heads-up Matt! Glad I could help you on this 🙂
I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
AuthorPosts
- The topic ‘RSS Feed of events filtered by organizer’ is closed to new replies.