Support » Themes and Templates » Display Values of Custom Fields in Post?

  • Hi Folks,
    almost there…I added a function to my functions.php file like so:

    function get_custom_field($key, $echo = FALSE) {
    	global $post;
    	$custom_field = get_post_meta($post->ID, $key, true);
    	if ($echo == FALSE) return $custom_field;
    	echo $custom_field;
    }

    I then experimented with adding <?php the_meta(); ?> to the single.php file.
    This got my custom field keys and values to display in the body of a post. HOWEVER, I only want the values of the keys to display. For example, I have a custom field key called Phone Number. I only want to show the value, i.e. 555-555-1234
    Is there a simple php method that can do that?
    Also, is there a way to make a url that is a custom field value an actual link?
    Cheers,
    Jenn

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display Values of Custom Fields in Post?’ is closed to new replies.