yes, you can modify it’s template file at events-manager/templates/templates/rss.php and then change the scope eg. today
to use templates: http://wp-events-plugin.com/documentation/using-template-files/
http://wp-events-plugin.com/tutorials/create-your-own-event-scope/
Thread Starter
thinib
(@thinib)
Thanks angelo,
But I don’t want to change the scope. I still want all future events.
However, I just want to list events in the RSS that have been recently added. A bit like the RSS feed for a blog?
I’m not sure if this is possible if the pubdate is the same as the event date?
Thread Starter
thinib
(@thinib)
Thanks Caimin,
But this seems to give me the same feed as http://www.gleanreport.com/events/feed or even http://www.gleanreport.com/events/categories/wellington/feed/ which I can already use.
What I really want to do is only have newly posted events coming up in the RSS feed, not all future ones.
Thread Starter
thinib
(@thinib)
Thanks Angelo,
I really appreciate your help.
I think you’re right, the problem is that the pubdate in the RSS field is the Event start date. Can you tell me how to change this line:
<pubDate><?php echo date(‘D, d M Y H:i:s T’, $EM_Event->start); ?></pubDate>
so that the $EM_Event->start is not the start time but the Post time?
Try:
<pubDate><?php echo date('D, d M Y H:i:s T', $EM_Event->created); ?></pubDate>
Thread Starter
thinib
(@thinib)
Thanks Caiman,
But that is just giving me a pub date of Thu, 01 Jan 1970 00:00:00 UTC for every item.
I’ve tried all sorts of variations, and can’t seem to get it to work.
Is there a reason why the pubdate is the Event start date? Will the RSS feed not order chronologically if I change it?
Thread Starter
thinib
(@thinib)
Hi again,
I think I’m on the wrong track with the pubdate. What I need to do is change the scope, as Angelo first suggested, but to a custom scope, that relates to the event_creation_date.
So I’d like to include events that were created up to 3 days prior to today’s date. I have created the following snippet, and added it to my functions.php file, but it’s not working. Any suggestions?
http://pastebin.com/9F0aB8Fx
here another snippet which can help you out – http://pastebin.com/bgednURB
Thread Starter
thinib
(@thinib)
Thanks Angelo,
I’m still working on this.
Can you tell me, would this code work for event_creation_date or event_modification_date rather than event_start_date or event_end_date?
Thread Starter
thinib
(@thinib)
I got it! I used event_date_created instead of event_creation_date and it now works.
Thanks for all your help.
Thread Starter
thinib
(@thinib)
One more question – now that I have this working as a custom scope, can I use it to create a conditional placeholder?
Thread Starter
thinib
(@thinib)
For example, I’ve tried to create the following, but wondering if there are other snippets of similar coding I could look at as this doesn’t work?
add_action('em_event_output_condition', 'my_em_styles_event_output_condition', 1, 4);
function my_em_styles_event_output_condition($replacement, $condition, $match, $EM_Event){
if( is_object($EM_Event) && preg_match('//^is_newposts$//',$condition, $matches) ){
if( in_array('scope'=>'newposts') ){
$replacement = preg_replace("/\{\/?$condition\}/", '', $match);
}else{
$replacement = '';
}
}
return $replacement;
}
maybe you can used php condition instead
eg.
if ( $EM_Event->start > current_time('timestamp') ){
...
}esle{
...
}
instead of
if( in_array('scope'=>'newposts') ){
...
}