Last active
December 21, 2015 13:19
-
-
Save barbwiredmedia/6312326 to your computer and use it in GitHub Desktop.
Wordpress - Functions: Calls a 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
// Enamble Custom Field output in functions.php | |
function print_custom_field($custom_field) { | |
global $post; | |
$custom_field = get_post_meta($post->ID, $custom_field, true); | |
echo $custom_field; | |
} | |
// Prints function | |
<?php print_custom_field('{name}'); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment