output text as html link?

I have a "Website" field that is set to text, and I'm wondering how to make it display as a website address? The only data entered in that field will be the address (e.g. http://www.xyz.com). I have a few other single-line text fields I'd like to display as an href, as well.

Any guidance anyone can give me on how to do this (modifying the CustomPress embed code, etc.) would be greatly appreciated!

  • Arun Basil Lal

    Hey lorgra,

    You will have the embed code for the custom-field similar to this:

    <?php echo get_post_meta( $post->ID, '_ct_text_4f5678b7a87f6', true ); ?>

    Now this will output the text that is going into the box, you say it would be just links.
    To make it look like a hyper link, use something like the following in the WordPress loop:

    <a href="<?php echo get_post_meta( $post->ID, '_ct_text_4f5678b7a87f6', true ); ?>"><?php echo get_post_meta( $post->ID, '_ct_text_4f5678b7a87f6', true ); ?></a>

    Now the link would be hyperlinked to itself. Easy.

    Let me know if you have more questions, g luck!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.