Custom RSS, Grouped events

This topic contains 2 replies, has 2 voices, and was last updated by  AK 6 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32021

    Hi,

    I´m trying to customize the RSS feed a little,
    so far I have managed to add event date via the_content -filter and is_feed() -condition
    (inspired by this post https://digwp.com/2012/10/customizing-wordpress-feeds/ )

    There is an option under “Settings” > “Event organiser”, called “Group occurrences”.
    Is it possible to programmatically set this checked only for the RSS listing?
    …while inside the is_feed() condition

    I only want each event listed once for the RSS feed

    Thanks!

    AK
    #32050

    This should probably work:

    add_action( 'pre_get_posts', function($query){
         if($query->is_feed()){
            $query->set('group_events_by','series_indeterminate');
         }
    });
    
    Stephen Harris
    #32065

    Thank you Stephen, it works great!

    AK
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.