How to add “Read More” link to the infobox content


In this tutorial, you’ll learn how to add a custom “Read More” link to the end of your infobox content/custom content #. Depending on the setting of the Infobox & carousel item links #, the “Read More” link will open the single post page or the outer link!

Add the following code to the file “functions.php” of your theme/child theme:

function cspm_add_read_more_to_infobox($default_description, $post_id){

	if(!class_exists('CspmMainMap'))
		return $default_description; 
	
	$CspmMainMap = CspmMainMap::this();
	
	$the_permalink = $CspmMainMap->cspm_get_permalink($post_id);
	
	$read_more = ' <a href="'.$the_permalink.'" data-post-id="'.$post_id.'">Read More</a>';
  
	return $default_description . $read_more;
			
}
add_filter('cspm_custom_infobox_description', 'cspm_add_read_more_to_infobox', 10, 2);

In the same context