Created
April 27, 2016 20:20
-
-
Save feliciaceballos/bf02ad39c552b7d54c5ac451d301aa7d to your computer and use it in GitHub Desktop.
Bill Erickson Get Custom Field
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 get_custom_field($field) { | |
global $post; | |
$value = get_post_meta($post->ID, $field, true); | |
if ($value) return esc_attr( $value ); | |
else return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment