Hello,
It is possible show the booking form above the content?
Can you please tell me how to do it?
Thanks
Nicola Bonotto
Hi Nicola,
This snippet will do it:
<?php
add_filter( 'eventorganiser_pro_get_option_disable_automatic_form', '__return_true' );
add_filter( 'the_content', function( $content ) {
$p_id = get_the_ID();
if( is_singular( 'event' ) && 'event' == get_post_type( $p_id ) ){
$content = eo_get_booking_form( $p_id ) . $content;
}
return $content;
}, 999 );
However, that will put the content before the event details as well. If you need it after the event details then that’s possible too, by editing the templates.
The above snippet should go in a custom plugin or theme’s functions.php.
Stephen Harris
Hi Stephen, today I tried to rearrange the layout of the single event page. I need to order information in this way:
- Event title
- Description (from post content)
- Event details
- Booking form
I followed the documentation but I could only get the booking form to appear either between the ‘Description’ and the [‘Event details’, or above the ‘Description’ (with the above PHP snippet). I could not get it to appear at the very bottom.
Would you be able to explain how to get the information presented in the required order?
Many thanks,
René
René Vlak
So first you’d need to create you’re own single-event.php
with the event description below the post content (which I think you’ve down).
That will get you to situation where you have:
- title
- description
- booking form
- event details
To get the booking form below the event details, first uses the following to disable automatic rendering of the booking form:
add_filter( 'eventorganiser_pro_get_option_disable_automatic_form', '__return_true' );
and then back in the single-event.php
call:
echo eo_get_booking_form( get_the_ID() );
wherever you want the form to appear.
Stephen Harris