0

I’m trying to show one of my custom fields as a link that downloads a photo. I’ve entered the URL in the field value but struggling to come up with the correct html to get it to display as a downloadable link.

<?php
// Display Custom Field Value
echo "<ul>";
echo "<li>License Type: ".get_post_meta( $post->ID, 'License Type', true )."</li>";
echo "<li>Download Comp: ".get_post_meta( $post->ID, 'Download Comp, true )."</li>"; 
echo "</ul>";
?>

I’d like the ‘Download Comp’ to display ‘click here’ which would obviously be taken to the URL that I’ve already entered. Thanks

1 Answer 1

1
<?php
// Display Custom Field Value
echo "<ul>";
echo "<li>License Type: ".get_post_meta( $post->ID, 'License Type', true )."</li>";
echo '<li><a href="' . get_post_meta( $post->ID, 'Download Comp', true ) . '">Download Comp</a></li>'; 
echo "</ul>";
?>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.