Add Custom Placeholder
-
Hi,
Referencing https://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/ I’ve been attempting to add a custom placeholder function to my theme’s functions.php that will only show the event’s start date even if there is an end date selected. I’m using the code shown below and can’t seem to figure out why it’s breaking my site. Any idea what I’m doing wrong? Any help you can offer would be greatly appreciated. I love the plugin!
add_filter('em_event_output_placeholder','my_em_styles_placeholders',1,3); function my_em_styles_placeholders($replace, $EM_Event, $result){ global $wp_query, $wp_rewrite; switch( $result ){ case '#_EVENTSTARTDATE': $date_format = ( get_option('dbem_date_format') ) ? get_option('dbem_date_format'):get_option('date_format'); if( $this->event_start_date != $this->event_end_date){ $replace = date_i18n($date_format, $this->start); } break; } return $replace; }
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Add Custom Placeholder’ is closed to new replies.