Hi. I’m trying to use the info in template_tags.php to change the link for Event Venue from the EE Venue Page to the Venue website.
I’m doing this in the content-espresso_events-venues template
<h4><?php _e( ‘Venue:’, ‘event_espresso’ ); ?> <?php espresso_venue_name ( $VNU_ID = 0, $link_to = ‘website’); ?></h4>
The puts appends the venue website to the post url, but I just want the venue website.
I am using template_tags.php as a reference, here:
if ( ! function_exists( ‘espresso_venue_name’ )) {
/**
* espresso_venue_name
*
* @access public
* @param int $VNU_ID
* @param string $link_to – options( details, website, none ) whether to turn Venue name into a clickable link to the Venue’s details page or website
* @return string
*/
function espresso_venue_name( $VNU_ID = 0, $link_to = ‘details’ ) {
EE_Registry::instance()->load_helper( ‘Venue_View’ );
echo EEH_Venue_View::venue_name( $link_to, $VNU_ID );
}
}
Thanks, that would work but I’m trying to display the Venue Name (default), but have it link to the Venue Website (option) instead of the EE Venue Page (default) for that Venue.
The code I included above has an option to do just this, but I’m not able to set the parameters correctly.
sorry, you’re right. It works if the url is formatted with http://, not otherwise. That was my problem. Thank you
Viewing 4 reply threads
The support post ‘Venue-link to website’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.