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
- Open the single post page inside a modal
- Programmatically change single map language based on the URL’s language attribute
- Synchronize the ACF map field with the map fields in “Progress Map”
- Set the zIndex of a specific marker
- Replace/override your map query settings to showcase diverse locations on any page
- Show locations based on a keyword search
- Display “Progress Map” metabox on “Envira Gallery” add/edit page
- How to add custom class names to the infoboxes
- Programmatically change the content of the carousel items
- Programmatically change the content of the infobox
- Programmatically change the title of the infobox
- Make the plugin GDPR/DSGVO compliance
- Trigger marker events
- Center the map on a specific marker on page load
- Open the locations/posts “Nearby places” map inside a modal
- Redirect to the single post on marker click
- Insert a map inside a taxonomy page and display locations based on the current taxonomy term
- Use marker popups to display the post ID
- Change the text of the button “Toggle Carousel”
- Use the StreetView image as the carousel items image
- Hide the Points of Interest from the map
- Import/Export your maps between WordPress websites
- Import/Export your map locations between WordPress websites