• Resolved ajmo

    (@ajmo)


    I use events-manager to show forthcoming events of a gardening club, and by editing the event content after it has finished we use it to record highlights (e.g.photos visit reports etc.)
    I would like either:
    A) an additional custom template for a past events-list or
    B) A way of using the [event] shortcode to pick up the previous (ie scope is ‘past’ limit is 1)

    Can this be done already or do I need to look at a custom shortcode?

    Thank you.

    https://wordpress.org/plugins/events-manager/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Something like this should work fine:

    [events_list scope="past"]

    Thread Starter ajmo

    (@ajmo)

    Hi caiman_nwl,

    Thanks your reply, apologise my delay in so doing. I was aware of being able to do that in the events list. I want to keep the events list format as is for one page, but separately show a single event itself (the most recent one that has taken place ) on a separate page, using something like:-
    [event scope=”past” ] but this does not work since this shortcode requires a postid to pick up a specific event. Even then I would like to be able to format this event differently from future events (e.g. not showing date/time/map etc).

    An alternative that I understand is not possible is to have a second template for the events_list.

    —-perhaps I am hoping for too much.

    Regards,

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Im afraid that scope attribute will not work on [event] shortcode since it’s per event or post id.

    Thread Starter ajmo

    (@ajmo)

    Hi angelo, I am grateful for your reply, I had appreciated the point you made. So my question is:

    Is it possible to display events in more than one format on differing pages?

    If this requires some customisation I am happy to have a crack at that. However from what I have read this does not seem to be possible because talk in the codex refers to ‘over riding’ templates rather than adding additional. Or is this simply a semantic miss understanding on my part?

    Regards,

    Thread Starter ajmo

    (@ajmo)

    Ok as you probably guessed I am a novice at this. After much flapping around I have alighted on a solution. I have written a custom shortcode function as follows:

    function my_shortcodef($atts) {
    if (class_exists(‘EM_Events’)) {
    $events = EM_Events::get( array( ‘scope’=>’past’, ‘limit’=>1, ‘orderby’=>’name’) );
    foreach ($events as $event) {
    echo ($event->event_name).’
    ‘;
    echo ($event->post_content).’
    ‘;
    echo ‘——————————————————————
    ‘;}}}

    As you can see it lacks formatting but I can at least get hold of the data.

    Hope this approach is supportable.

    Regards,

    There are some built-in WordPress functions for checking which page is being displayed. This might help:
    http://justintadlock.com/archives/2011/07/20/conditional-checks-for-custom-post-types

    Thread Starter ajmo

    (@ajmo)

    Hi caiman, Thanks for your help

    Regards,

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

The topic ‘Past events – Events Manager’ is closed to new replies.