I have this Shortcode:
[eo_events title=fußreflexzonenmassage-I numberposts=5 showpastevents=false]
<div class=”column one-third”>%event_title%
</div>
<div class=”column one-fifth”>%event_venue%</div>
<div class=”column one-fourth”>%start{j.m.}% – %end{j.m.o}%</div>
<div class=”column one-fifth”>Jetzt buchen</div>
[/eo_events]
but I have so much events I need a shorter on
eg.:
[eo_events-shortcode title=fußreflexzonenmassage-I numberposts=5 showpastevents=false]
[/eo_events-shortcode
how can I do this?]
Christoph Steinlechner
Hi Christoph,
You’re trying to list events by title, with their dates underneath right?
There are two ways you can do this with shortcodes:
- Use the event shortcode template
- Register your own shortcode which pre-fills the settings.
I would use (1) if you are not re-using the shortcode template elsewhere. (See http://docs.wp-event-organiser.com/shortcodes/events-list/)
For (2), see https://wp-event-organiser.com/blog/tutorial/creating-your-own-shortcodes/
Something like:
add_shortcode( 'my_shortcode', function( $atts, $content = null ){
return do_shortcode( sprintf( '[eo_events title=%s numberposts=5 showpastevents=false]
<div class="column one-third">%event_title%</div>
<div class="column one-fifth">%event_venue%</div>
<div class="column one-fourth">%start{j.m.}% – %end{j.m.o}%</div>
<div class="column one-fifth">Jetzt buchen</div>
[/eo_events]',
$atts['title']
));
});
should work.
Stephen Harris