Custom placeholder to edit the title length lost links
-
I have managed to create my own custom placeholder called #_CUSTOMTITLE and edit the length….but I have lost my link to the event. I will add the code I have used in my functions.php below, can you tell me where I have managed to remove the events link:
‘//create the filter. the website will search for our placeholder using this function
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 ‘#_CUSTOMTITLE’: // name of the placeholder
$replace = $EM_Event->output(“#_EVENTLINK”); //lets retrieve the original event data so we can modify it
$replace = preg_replace(‘/<[^>]+./’,”, $replace); // make the modification of taking out any images
if($result == “#_CUSTOMTITLE”){ //heres what we are goign to do if the placeholder has been foundif ( str_word_count($replace) > 5 ) {
$length = 5; //length of word for (the title)
$replace = implode(‘ ‘,array_slice(explode(‘ ‘, $replace),0,$length)); //apply the length amount to the output
$replace = $replace . ‘… ‘; //add 3 periods after lenth has been reached
}
}
break; // end the case
}
return $replace; //output the placeholder
}’
- The topic ‘Custom placeholder to edit the title length lost links’ is closed to new replies.