0

I have a custom field that contains a bunch of urls in it. I want them to be clickable links in that custom field only. How can I do this? I could just manually convert them to html links but that's too time consuming for 100+ links

1 Answer 1

4

Use the function make_clickable():

$text = get_post_meta( get_the_ID(), 'my_key', TRUE );
echo make_clickable( $text );
2
  • where do I place that code? do I replace my_key with the name of the custom field?
    – Ruriko
    Commented Jul 30, 2013 at 12:05
  • Yes, exactly. Where you want to print or store the result is up to you.
    – fuxia
    Commented Jul 30, 2013 at 12:07

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.