Created
December 15, 2011 19:35
-
-
Save timnovinger/1482486 to your computer and use it in GitHub Desktop.
Colorjar: Get custom field in WP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_field($key) { echo get_custom_field($key); } | |
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment