Title: gleanreport's Replies | WordPress.org

---

# gleanreport

  [  ](https://wordpress.org/support/users/gleanreport/)

 *   [Profile](https://wordpress.org/support/users/gleanreport/)
 *   [Topics Started](https://wordpress.org/support/users/gleanreport/topics/)
 *   [Replies Created](https://wordpress.org/support/users/gleanreport/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/gleanreport/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/gleanreport/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/gleanreport/engagements/)
 *   [Favorites](https://wordpress.org/support/users/gleanreport/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/users/gleanreport/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/gleanreport/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/page/2/#post-18814114)
 * Thank you [@msykes](https://wordpress.org/support/users/msykes/) and [@joneiseman](https://wordpress.org/support/users/joneiseman/)–
   after a lot of testing (and trial and error) I have got this working! Really 
   appreciate your help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/rss-feed-by-category-4/page/2/#post-18766105)
 * Thanks [@msykes](https://wordpress.org/support/users/msykes/)
 * Can you please tell me whether ‘New Posts’ in Settings > Formatting > RSS settings
   is my custom setting or a generic Events Manager setting?
 * Also – I have narrowed down the offending code to the following snippet in my
   functions.php file. If you have any suggestions for solving this issue (and I
   don’t expect you to spend time coding) I would really appreciate it:
 * add_filter( ’em_events_build_sql_conditions’, ‘my_em_scope_conditions’,1,2);
   
   function my_em_scope_conditions($conditions, $args){if( !empty($args[‘scope’])&&
   $args[‘scope’]==’newposts’ ){$start_date = date(‘Y-m-d H:i:s’,strtotime(“-3 days”,
   current_time(‘timestamp’)));$conditions[‘scope’] = ” ( event_date_modified >=‘
   $start_date’) OR ( event_date_created >= ‘$start_date’)”;}return $conditions;}
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/page/2/#post-18749659)
 * Thanks [@msykes](https://wordpress.org/support/users/msykes/)!
 * I didn’t realise that RSS setting was there, that’s great. If I choose “New Posts”,
   how far back do those posts go? And does it include modified posts? Or is that
   scope simply drawing from my own custom code?
 * Kind regards,
 * Ruth
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/#post-18745857)
 * Thanks so much [@msykes](https://wordpress.org/support/users/msykes/)
 * I removed the functions.php file competely (which did nothing) but then cleared
   the cache – and the feeds worked (sort of)! The “wellington” RSS feed pulled 
   every post from the wellington category all the way back to 2014 when the site
   began. The “online” RSS feed appeared to pull every post from when the “online”
   category began in October.
 * Do you have any suggestions for tweaking the following code in the functions.
   php file so that only posts entered or modified in the last 3 days are pulled
   up in the two RSS feeds – while keeping only that category’s events in the appropriate
   feed?
 *     ```wp-block-code
       <?phpadd_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);function my_em_scope_conditions($conditions, $args){        if( !empty($args['scope']) && $args['scope']=='newposts' ){                $start_date = date('Y-m-d H:i:s',strtotime("-3 days", current_time('timestamp')));                $conditions['scope'] = " ( event_date_modified >= '$start_date') OR ( event_date_created >= '$start_date')";        }        return $conditions;}add_filter( 'em_get_scopes','my_em_scopes',1,1);function my_em_scopes($scopes){$my_scopes = array('newposts' => 'New Posts');return $scopes + $my_scopes;}add_action('em_event_output_show_condition', 'my_em_new_event_output_show_condition', 1, 4);function my_em_new_event_output_show_condition($show, $condition, $full_match, $EM_Event){    if( "is_newpost" == $condition ){        $postdate = get_post_datetime($EM_Event->post_id)->format('Y-m-d');        $threedaysago = date('Y-m-d', strtotime('-3 days', current_time('timestamp')));        $show = strtotime($postdate) >= strtotime($threedaysago) ? true : false;    }    return $show;}/*** Custom post type for Subscribe2*/function custom_s2_post_types($types) {$types[] = 'event';return $types;}add_filter('s2_post_types', 'custom_s2_post_types');add_filter('s2_post_types','my_post_types');function my_taxonomy_types($taxonomies) {$taxonomies[] = 'event-categories';return $taxonomies;}add_filter('s2_taxonomies','my_taxonomy_types');
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/#post-18744023)
 * Thanks [@msykes](https://wordpress.org/support/users/msykes/), I really appreciate
   your help.
 * I have tried clearing the cache, but it has not changed the “online” url feed.
 * I’m wondering if the issue may be because the feed is limited to posts added 
   in the last 3 days? This is the code in the functions.php that does this:
 *     ```wp-block-code
       <?phpadd_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);function my_em_scope_conditions($conditions, $args){if( !empty($args['scope']) && $args['scope']=='newposts' ){$start_date = date('Y-m-d H:i:s',strtotime("-3 days", current_time('timestamp')));$conditions['scope'] = " ( event_date_modified >= '$start_date') OR ( event_date_created >= '$start_date')";}return $conditions;}add_filter( 'em_get_scopes','my_em_scopes',1,1);function my_em_scopes($scopes){$my_scopes = array('newposts' => 'New Posts');return $scopes + $my_scopes;}add_action('em_event_output_show_condition', 'my_em_new_event_output_show_condition', 1, 4);function my_em_new_event_output_show_condition($show, $condition, $full_match, $EM_Event){if( "is_newpost" == $condition ){$postdate = get_post_datetime($EM_Event->post_id)->format('Y-m-d');$threedaysago = date('Y-m-d', strtotime('-3 days', current_time('timestamp')));$show = strtotime($postdate) >= strtotime($threedaysago) ? true : false;}return $show;}
       ```
   
 * Maybe this is overiding the template files?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/#post-18677602)
 * Thanks [@joneiseman](https://wordpress.org/support/users/joneiseman/)
 * Could it be because I have custom code in the feed-rss2 file, for example:
 *     ```wp-block-code
       do_action('rss2_head'); ?>	<?php if('event' == get_post_type() ): ?>	<?php		$description_format = str_replace ( ">", ">", str_replace ( "<", "<", get_option ( 'dbem_rss_description_format' ) ) );		$category = get_the_terms( get_the_id(), 'event-categories' ); //////find custom taxonomy category name		foreach ( $category as $cat){			$evcat = $cat->term_id;		}		$EM_Events = EM_Events::get( array('scope'=>'month', 'owner'=>false, 'category'=> $evcat) ); // this line pulls in JUST the specified category... and the SCOPE nextfortnight is my own custom scope, replace it with yours or a default I replaced with month/		foreach ( $EM_Events as $EM_Event ) {			$description = $EM_Event->output( get_option ( 'dbem_rss_description_format' ), "rss");			$description = ent2ncr(convert_chars(strip_tags($description))); //Some RSS filtering			$event_url = $EM_Event->output('#_EVENTURL');			?>			<item>				<title><?php echo $EM_Event->output( get_option('dbem_rss_title_format'), "rss" ); ?></title>				<link><?php echo $event_url; ?></link>				<guid><?php echo $event_url; ?></guid>				<description><?php echo $description; ?></description>			</item>			<?php		}		?>	<?php else : ?>		<?php while( have_posts()) : the_post(); ?>c
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/#post-18676889)
 * Thanks [@joneiseman](https://wordpress.org/support/users/joneiseman/), I really
   appreciate your help.
 * I have tried adding the snippet in Code Snippets but it is still bringing the
   whole RSS feed not just the online category.
 * This is the list of events the RSS should be bringing up and only the ones added
   in the last 3 days: [https://www.gleanreport.com/online/](https://www.gleanreport.com/online/)
 * I’ve tried:
 * [https://www.gleanreport.com/events/feed/?category=online](https://www.gleanreport.com/events/feed/?category=online)
 * and
 * [https://www.gleanreport.com/events/categories/online/feed/](https://www.gleanreport.com/events/categories/online/feed/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/#post-18676105)
 * Thanks for that – unfortunately this still pulls all the events into the RSS 
   feed, not just the online category events.
 * I’ve tried playing with the URL and it still doesn’t work.
 * Any ideas gratefully received!
    -  This reply was modified 8 months, 1 week ago by [gleanreport](https://wordpress.org/support/users/gleanreport/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] RSS feed by category](https://wordpress.org/support/topic/rss-feed-by-category-4/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/rss-feed-by-category-4/#post-18673952)
 * Thanks I have added that code to the Functions.php file.
 * However, I am now just looking for the url for the text based RSS feed – the 
   url provides a ics feed of events for a calendar instead
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Conditional placeholder not working](https://wordpress.org/support/topic/conditional-placeholder-not-working/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/conditional-placeholder-not-working/#post-18451940)
 * Confirmed that it is working thank you so much! Is there a way to add posts that
   are modified in the past 3 days as well as those that have been created?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Conditional placeholder not working](https://wordpress.org/support/topic/conditional-placeholder-not-working/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/conditional-placeholder-not-working/#post-18443171)
 * That appears to be working! Thank you so much. I’ll test it over the next few
   days and confirm.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Conditional placeholder not working](https://wordpress.org/support/topic/conditional-placeholder-not-working/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/conditional-placeholder-not-working/#post-18438569)
 * Thanks for providing this code snippet. I have tried using the code but it does
   not bring up the *NEW* label before the text for events created within the last
   three days.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Custom shortcode not working after upgrade](https://wordpress.org/support/topic/custom-shortcode-not-working-after-upgrade/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/custom-shortcode-not-working-after-upgrade/#post-17730338)
 * This conditional placeholder is still not working – any ideas when this might
   be fixed?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Custom shortcode not working after upgrade](https://wordpress.org/support/topic/custom-shortcode-not-working-after-upgrade/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/custom-shortcode-not-working-after-upgrade/#post-17420338)
 * Apologies, this is a conditional placeholder not custom shortcode. Any chance
   that it will be fixed in the next update for Events Manager?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Custom shortcode not working after upgrade](https://wordpress.org/support/topic/custom-shortcode-not-working-after-upgrade/)
 *  Thread Starter [gleanreport](https://wordpress.org/support/users/gleanreport/)
 * (@gleanreport)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/custom-shortcode-not-working-after-upgrade/#post-17382557)
 * Actually, this is is bringing up every event as newposts! Is there a way to only
   bring up the ones that are -3 days old?

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/users/gleanreport/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/gleanreport/replies/page/2/?output_format=md)