I'm using the following code to display several custom fields on my posts in WordPress, but the URL field doesn't work as I want and I don't know how to solve it:
$destino_web = get_post_meta( get_the_ID(), 'web', true);
$destino_telefono = get_post_meta( get_the_ID(), 'telefono', true);
$destino_precio = get_post_meta( get_the_ID(), 'precio', true);
$destino_horario = get_post_meta( get_the_ID(), 'horario', true);
if( ! empty( $destino_web ) ) { echo '<p><strong>Web:</strong><a href="' . $web . '"><?php get_the_title(); ?></a></p>'; }
if( ! empty( $destino_telefono ) ) { echo '<p><strong>Telefono:</strong> ' . $destino_telefono . '</p>'; }
if( ! empty( $destino_precio ) ) { echo '<p><strong>Precio:</strong> ' . $destino_precio . '</p>'; }
if( ! empty( $destino_horario ) ) { echo '<p><strong>Horario:</strong> ' . $destino_horario . '</p>'; }
I would like to display the post title with my custom URL.