I am currently editing a wordpress theme with custom field outputs. I successfully made all the changes and everything works as it should. My problem is that if the URL is sent to a custom field, the echo is exactly what was there, so if someone goes to www.somesite.com, the echo just adds it to the end of the domain : www.mysite.com www.somesite.com. I want to check if the supplied channel has the http://
prefix at the beginning, if it then performs both actions, but if it does not output http://
in front of the URL.
I hope I explained my problem as best as I can.
$custom = get_post_meta($post->ID, 'custom_field', true); <?php if ( get_post_meta($post->ID, 'custom_field', true) ) : ?> <a href="<?php echo $custom ?>"> <img src="<?php echo bloginfo('template_url');?>/lib/images/social/image.png"/></a> <?php endif; ?>
Rory web rothon
source share