Advertisement
supportnwl

add booked remaining space at calendar widget

Sep 5th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. 1. create folders plugins > events-manager > templates within your current theme directory.
  2. 2. go to wp-content > plugins > events-manager > templates > templates and copy php file calendar-small.php
  3. 3. paste calendar-small.php to your newly created EM folders within your theme then insert this snippet
  4.  
  5.  
  6. if ( !empty($cell_data['events']) ){
  7. foreach( $cell_data['events'] as $EM_Event ){
  8. $spaces = $EM_Event->output("#_BOOKEDSPACES/#_AVAILABLESPACES/#_SPACES");
  9. }
  10. $spaces = " - ".$spaces;
  11. }
  12.  
  13. before
  14.  
  15. $class = ( !empty($cell_data['events']) && count($cell_data['events']) > 0 ) ? 'eventful':'eventless';
  16.  
  17. then
  18.  
  19. replace
  20.  
  21. <a href="<?php echo esc_url($cell_data['link']); ?>" title="<?php echo esc_attr($cell_data['link_title']); ?>"><?php echo date('j',$cell_data['date']); ?></a>
  22.  
  23. with
  24.  
  25. <a href="<?php echo esc_url($cell_data['link']); ?>" title="<?php echo esc_attr($cell_data['link_title'].$spaces); ?>"><?php echo date('j',$cell_data['date']); ?></a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement