Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- This snippet is for Events Manager for WordPress and adds a little CSS to make the booking form responsive and moves the login form above the booking form.
- For information on how to install this snippet, see this page - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
- */
- function my_em_event_booking_form_responsive($replace, $EM_Event, $result){
- switch( $result ){
- case '#_BOOKINGFORM':
- if( !is_user_logged_in() ){
- //User is not logged in, show login form (enabled on settings page)
- ob_start();
- em_locate_template('forms/bookingform/login.php',true, array('EM_Event'=>$EM_Event));
- $replace = ob_get_clean() . $replace;
- }
- break;
- }
- return $replace;
- }
- add_filter('em_event_output_placeholder','my_em_event_booking_form_responsive',1,3);
- function my_em_event_booking_form_responsive_css(){
- ?>
- <style type="text/css">
- div.em-booking-form-details { float: none; width:auto; }
- div.em-booking-form-details p label { float:none; width:auto; display:block; }
- div.em-booking-form-details input[type="text"], div.em-booking-form-details select, div.em-booking-form-details textarea { width:99%; padding:1%; }
- div.em-booking-login { float:none; margin:0px !important; border:0px !important; }
- div.em-booking div.em-booking-login { display:none; }
- </style>
- <?php
- }
- add_action('wp_head', 'my_em_event_booking_form_responsive_css');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement