Here is the code I'm using to add a custom field to a post type I have set up. As you can see it creates an input box which allows me to add whatever I want. I want to put urls in this box (without the "http://", e.g. "example.com") and have them be automatically clickable. Is there a way?
add_action("admin_init", "add_friends_fields");
function add_friends_fields(){
add_meta_box("artist_links", "Links", "artist_links", "friends", "normal", "low");
}
function artist_links(){
global $post;
$custom = get_post_custom($post->ID);
$artist_links = $custom["artist_links"][0];
?>
<label>Links:</label><br /><br />
<input size="50" name="artist_links" value="<?php echo $artist_links; ?>" />
<?php
}
-edit-
<section id="artists">
<h2 class="title"><span>Artists</span></h2>
<?php
$i=1;
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query('post_type=friends&posts_per_page=-1');
while ( $wp_query->have_posts() ) : $wp_query->the_post();
$custom = get_post_custom($post->ID);
$artist_links = $custom["artist_links"][0];
$artist_bio = $custom["artist_bio"][0];
?>
<article class="mgm-artist<?php if($i%6 == 0) { echo ' right'; }; $i++; ?>" id="post-<?php the_ID(); ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'video-thumb' ); } ?>
<section class="artist-details">
<p><span>Name:</span> <?php the_title(); ?></p>
<p><span>Bio:</span> <?=$artist_bio?></p>
<p><span>Link(s):</span> <?=$artist_links?></p>
</section>
</article>
<?php
endwhile;
$wp_query = null;
$wp_query = $temp;
wp_reset_query();
?>
</section>
