Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This snippet will create new placeholder for event details excerpt with limits
- to any given characters which in this case 10.
- */
- add_filter('em_event_output_placeholder','my_em_custom_excerpt_placeholders',1,3);
- function my_em_custom_excerpt_placeholders($replace, $EM_Event, $result){
- switch( $result ){
- case '#_CUSTOMEXCERPT':
- $replace = $EM_Event->output("#_EVENTEXCERPT");
- $replace = preg_replace('/<[^>]+./','', $replace);
- if($result == "#_CUSTOMEXCERPT"){
- if ( strlen($replace) > 10 ) {
- $length = 10;
- $replace = substr($replace,0,$length);
- }
- $replace = $replace . '... ';
- }
- break;
- }
- return $replace ;
- }
- /*
- 2. use this custom placeholder in your default listing at Events > Settings > Formatting > Events > Default event list format
- */
- => Default event list format header
- <table cellpadding="0" cellspacing="0" class="events-table" >
- <thead>
- <tr>
- <th class="event-time" width="150">Date/Time</th>
- <th class="event-description" width="*">Event</th>
- <th class="event-description" width="*">Details</th>
- </tr>
- </thead>
- <tbody>
- => Default event list format
- <tr>
- <td>
- #_EVENTDATES<br/>
- #_EVENTTIMES<br/>
- </td>
- <td>
- #_EVENTLINK
- {has_location}<br/><i>#_LOCATIONNAME, #_LOCATIONTOWN #_LOCATIONSTATE</i>{/has_location}
- </td>
- <td> #_CUSTOMEXCERPT </td>
- </tr>
- => Default event list format footer
- </tbody></table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement