Created
October 6, 2017 13:51
-
-
Save sureshHARDIYA/e4101169274cb01fb328a4f9f3021a48 to your computer and use it in GitHub Desktop.
Retrieving custom fields
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
<?php | |
<?php | |
// Display Custom Field Value | |
echo get_post_meta( $post->ID, 'my-field-slug', true ); | |
// You can also use | |
echo get_post_meta( get_the_ID(), 'my-field-slug', true ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment