• I’m using WP Show Posts to display featured upcoming EM events and I’d like events that have already occurred to be set as Private automatically so that they will no longer display on the site. Is there any way to do this using a function? Or maybe there’s already an EM setting for this that I just haven’t seen?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    at the moment you need to hook into em_event_save filter to set the event as private automatically when create events; for reference, this is located under events-manager/classes/em-event.php

    I am not part of support.. just some dude.

    I found your question interesting… I don’t use WP Show Posts.. although I use something similar.

    But I am curious… is it you want to “hide” the event by making it private ?
    Or just not appear on the page ?

    I did look very briefly at WP Show Posts.. and I don’t know if your generic posts are set to expire.. so they don’t show.. just as when an when an event expires.. it wouldn’t show or go to private.. and thusly doesn’t show either.

    and I don’t know if WP Show Posts is mixing together Events and generic posts with one short code.

    For not going the “private” method…
    In your Admin-> Settings -> Events Manager ->
    click the “tab” Pages
    scroll down to Event List/Archives click expand
    scroll down to WordPress Event Archives
    click Enable Archives Yes
    and below that… Event archives scope set to -> Future Events.

    I don’t know if WP Show Posts shortcode overrides Events Manager.. it shouldn’t.

    This method will make all your Events lists only to show future events.
    If you don’t want all your Events list to be only future events..

    In place of the shortcode for WP Show Posts…

    Then you could use a generic Events Manager shortcode, in place of WP Show Post..
    and set the scope=”future” .
    https://wp-events-plugin.com/documentation/shortcodes/
    [events_list scope="tomorrow" country="US"]<p>#_EVENTLINK will take place at #_LOCATIONLINK on #_EVENTDATES at #_EVENTTIMES</p>[/events_list]

    above is just a quick example.. there are tons of things you can do with the above shortcode and “placeholders”, to make it appear with images and what ever you want.

    Hope that helps.. with an alternative to “private”.

    • This reply was modified 6 years, 10 months ago by Robswaimea.
    Thread Starter pracko

    (@pracko)

    Thanks Angelo, that’s a bit more involved that what I want to deal with. In the meantime, I installed the Post Expirator plugin to handle this. Instead of setting the event to ‘Private’, it changes the event’s category, therefore making it disappear from the WPSP feed I set up for upcoming events.

    Thread Starter pracko

    (@pracko)

    Rob, I decided that I want to keep the event post visible in the blog feed, yet remove it from the WPSP feed I set up for upcoming events. Unfortunately, the sorting options in WPSP do not recognize the EM event start/end date, only the publish date, post ID, and other standard WP post meta, in descending or ascending order. Therefore, if I set WPSP to show upcoming events categorized as “Workshops” three across (horizontally) by date ascending, it will display my initial “Workshops” event post 1st even thought the event already occurred.

    I know about the method you described for displaying events natively using Event Manager template and shortcodes, but it’s not flexible or convenient enough for my layout requirements. Thanks for the suggestion though.

    It sounds as if you like the “grid” layout that WPSP is displaying for you.
    The grid layout of events has been discussed here a number of times.
    If that is the situation you can do a search.. I have post examples and some tutorials on it here, and others have chimed in on the setup.

    I’ve also used Post Expirator… (not for EM) if that works for you than cool enough ??

    • This reply was modified 6 years, 10 months ago by Robswaimea.
    Thread Starter pracko

    (@pracko)

    Yes, WPSP’s display flexibility is fantastic. I’ve got everything working just fine now, even though Post Expirator does require an extra step each time a new event is added, but not much.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Set completed events to private?’ is closed to new replies.