Title: Upcoming events shortcode
Last modified: August 22, 2016

---

# Upcoming events shortcode

 *  Resolved [MartaLi](https://wordpress.org/support/users/martali/)
 * (@martali)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/upcoming-events-shortcode-1/)
 * Hello!
 * I am using Event Rocket 2.5 with Events Calendar 3.8.1
 * I need to show the upcoming events in the home page for which I used the following
   code:
 * `[event_embed limit="3" from="now"] {thumbnail} {start_date} {title} [/event_embed]`
 * Much like it is stated in [this](https://wordpress.org/support/topic/considering-starting-date-only?replies=4)
   thread, I have events that stay active for a long period of time, and therefore
   they are showing up before the events that will actually start now.
 * For example I have these events:
    Course #1 from Jan 1st 2015 to Apr 4th 2015
   Course #2 from Mar 7th 2015 to May 6th 2015 Course #3 from Mar 30th 2015 to Jun
   20th 2015 Course #4 from Jun 6th 2015 to Jul 15th 2015
 * With the shortcode I am using I was expecting to show only courses #3 and #4 
   since they are the upcoming events. However it is showing also courses from #
   1 and #2.
 * I need to show **only the upcoming events with a start date from today onwards**.
   I do not want to show events that already started and are taking place even though
   they aren’t yet completed.
 * Please let me know what could be done to achieve this.
 * Thank you!
 * [https://wordpress.org/plugins/event-rocket/](https://wordpress.org/plugins/event-rocket/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/upcoming-events-shortcode-1/#post-5940698)
 * Hi!
 * What you’re experiencing is the expected behaviour.
 * Event Rocket is really just piggy-backing on The Events Calendar itself and, 
   when you query for events in a certain time range, the current behaviour is to
   include all events that start _or have not expired_ within that period.
 * You can certainly alter this behaviour by changing the conditions within the 
   query itself and, if you generally are happy with the way The Events Calendar
   behaves in this regard and only want to see this change in respect of the `[event_embed]`
   shortcode, that’s possible too:
    - A filter hook – `eventrocket_embed_event_args` – runs right before the shortcode’s
      event query
    - Simply by using this as a convenient jumping off point, you can consequently
      modify the query using standard WordPress hooks such as `posts_where`
    - So as to avoid impacting on other queries, be sure to tear down your callbacks
      once the changes have been made
 * …As you can see this sort of change would require you to be fairly comfortable
   with coding and developing in a WordPress environment 🙂
 * It’s possible I will consider adding a new shortcode parameter to make it easier
   to lock things down in the way you have described – `date-logic="strict"` or 
   something – however I’m not fully sold on the idea just yet.
 *  Thread Starter [MartaLi](https://wordpress.org/support/users/martali/)
 * (@martali)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/upcoming-events-shortcode-1/#post-5940757)
 * Hey Barry,
 * Thank you for your kind reply and help. I will try it as you suggested. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Upcoming events shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/event-rocket_dacd8c.svg)
 * [Event Rocket](https://wordpress.org/plugins/event-rocket/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-rocket/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-rocket/)
 * [Active Topics](https://wordpress.org/support/plugin/event-rocket/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-rocket/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-rocket/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [MartaLi](https://wordpress.org/support/users/martali/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/upcoming-events-shortcode-1/#post-5940757)
 * Status: resolved