Created
April 20, 2017 14:02
-
-
Save braddalton/a55374170d01dc22a059deefce813eea to your computer and use it in GitHub Desktop.
Add Custom Field To Genesis Loop https://wpsites.net/web-design/add-custom-field-to-genesis-loop/
This file contains hidden or 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 | |
/** | |
* @author Brad Dalton | |
* @link https://wpsites.net/web-design/add-custom-field-to-genesis-loop/ | |
*/ | |
add_action( 'genesis_entry_content', 'function_name', 12 ); | |
function function_name() { | |
$value = get_post_meta( get_the_ID(), 'key', true ); | |
if ( ! empty( $value ) ) { | |
echo '<div class="your-class">'. $value .'</div>'; | |
} | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment