Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created April 20, 2017 14:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save braddalton/a55374170d01dc22a059deefce813eea to your computer and use it in GitHub Desktop.
Save braddalton/a55374170d01dc22a059deefce813eea to your computer and use it in GitHub Desktop.
<?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