Winter Solstice sale! 30% Off code: SOLSTICE24 Shop Now

ends midnight 12/21 PST

How to show additional custom data in the eventCard

Last Updated: September 19, 2023

Step #1

Add the additional EventCard row, as a selectable option, into EventON settings. This is located under your EventCard Data section.

add_filter( 'eventon_eventcard_boxes','addfield_001' , 10, 1);
function addfield_001($array){
	$array['extra1']= array('evoextra1',__('Extra Box','eventon'));
	return $array;
}

Now you should see a new row labeled “Extra Box” as an option for selection in your EventON settings.

Move this custom data row, “Extra Box”, anywhere you want within the EventCard so the data fields are in the order that best suit your needs.

Step #2

Process data and show on the EventCard.

add_filter('eventon_eventcard_array', 'addfield_002', 10, 4);
add_filter('evo_eventcard_adds', 'addfield_003', 10, 1);
function addfield_002($array, $pmv, $eventid, $__repeatInterval){
	$array['extra1']=array(
		'event_id' =>$eventid,
		'pmv'=>$pmv,
		'__repeatInterval'=>(!empty($__repeatInterval)? $__repeatInterval:0)
	);
	return $array;
}
function addfield_003($array){
	$array[] = 'extra1';
	return $array;
}
 
add_filter('eventon_eventCard_extra1', 'addfield_004', 10, 2);
function addfield_004($object, $helpers){
	$event_post_meta_values = $object->pmv;
 
	ob_start();
	echo "<div class='evorow evcal_evdata_row bordb evcal_evrow_sm".$helpers['end_row_class']."' data-event_id='".$object->event_id."'>
		<span class='evcal_evdata_icons'><i class='fa fa-calendar-check-o'></i></span>
		<div class='evcal_evdata_cell'>";
		echo "<h3 class='evo_h3'>".__('Custom Title','eventon')."</h3>";
 
		// Any data for this section goes here	
		echo 'Data goes here';
 
		echo "</div>".$helpers['end'];
	echo "</div>";
					
	return ob_get_clean();
}

 

Now you can process your code and show whatever information you want inside your EventCard. The results should look similar to this:

Did this article help you?

Ready to setup your calendar?