Hello homme4, thank you for your reply.
I think you may have discovered an issue in the plugin.
While that’s addressed, I came up with this PHP snippet which worked for me:
<?php
/* Previous */
add_filter( 'tribe_the_prev_event_link', function( $link ) {
// Set the new string
$new_string = 'Previous';
// Get rid of HTML entity
$link = str_replace( '<span>«</span> ', '', $link );
// Parse the element
$a = new SimpleXMLElement( $link );
// Build the new link
$link = '<a href="' . $a["href"] . '">' . $new_string . '</a>';
return $link;
} );
/* Next */
add_filter( 'tribe_the_next_event_link', function( $link ) {
// Set the new string
$new_string = 'Next';
// Get rid of HTML entity
$link = str_replace( ' <span>»</span>', '', $link );
// Parse the element
$a = new SimpleXMLElement( $link );
// Build the new link
$link = '<a href="' . $a["href"] . '">' . $new_string . '</a>';
return $link;
} );
Please see here for our guide on adding custom code snippets: https://theeventscalendar.com/knowledgebase/k/best-practices-for-implementing-custom-code-snippets/
To clarify, you shouldn’t need to do this. What you were trying to do should have worked.
This snippet (well, two snippets: one for “Previous” and one for “Next”) is only meant as a temporary workaround while this is addressed in the plugin itself.
Once it’s addressed, you should be able to use functions like tribe_the_prev_event_link
as you were trying to.
Hope this helps. Please let us know how it goes.
Best regards,
Leland