Forum Replies Created
-
AuthorPosts
-
MattParticipant
Hi Nico,
Thanks for taking the time to look at this for me, I spent a bit of time looking into the problem and think I have cracked it! here is the updated code incase it helps anyone else:// Example URL [site url]/events/feed/?organizer=6 /* 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['organizer']) ){ //Get original meta query $meta_query = $query->get('meta_query'); //Add organizer meta query to the original meta queries $meta_query[] = array( 'key'=>'_EventOrganizerID', 'value'=> (int)$_REQUEST['organizer'], 'compare'=>'=', ); $query->set('meta_query',$meta_query); //print_r($query); } } add_action( 'pre_get_posts', 'tribe_alter_feed' );
Thanks again.
MattMattParticipantThis reply is private.
MattParticipantHi Nico,
you might need a bit of background to our setup we are running a WP network with a dedicated event site so the structure is currently [network-base-url][subsite][event calendar prefix]
so the url that works is https://www.cornwall.ac.uk/events/whats-on/feed/so on that url the feed seems to be working (with no filters)
Cheers
MattParticipantHi Barry,
Thanks for getting back to me.
I did try replacing the parameter with tribe_organizer=7 but then I get the error: ‘ERROR: This is not a valid feed.’
here is the full url I am using: https://www.cornwall.ac.uk/events/whats-on/feed/?tribe_organizer=7MattParticipantThats perfect!
Thanks very much for your help.
Cheers -
AuthorPosts