Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Forked from braddalton/archive.php
Created December 7, 2017 06:47
Show Gist options
  • Select an option

  • Save jamiemitchell/81ea55e54291188b6351c3d5293136a0 to your computer and use it in GitHub Desktop.

Select an option

Save jamiemitchell/81ea55e54291188b6351c3d5293136a0 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