I have tried everything to get Custom Fields to display on my posts using a Child Theme of the Genesis theme framework. I have tried to follow every tutorial I could find relating to it but still I can’t get my Custom Fields to show on my posts!

The simplest looking solution I have been trying is using Brad Daltons instructions (I have tried many other methods) and adding the following to my functions file:

add_action( 'genesis_after_post_title', 'custom_field_before_content' );
/**
* @author Brad Dalton - WP Sites
* @link http://wp.me/p1lTu0-9WF
*/
function custom_field_before_content() {
if(is_page() || is_single() ) {
genesis_custom_field('instrument');
}
}

I have then added the custom field in my posts. I have tried adding the custom field with Advanced Custom Fields which shows perfectly in the admin but not on the post on my site.

Does anyone know what I am doing wrong to get this to output or a different method that might work for me. I done this no problem with different themes but using the Genesis theme framework I can’t get this to work – have been at it for two days!

Thanks,

Ciarán

3 Answers
3

How about instead of genesis_custom_field('instrument'); use: echo genesis_get_custom_field('instrument');

Plus the genesis_after_post_title action hook is deprecated since 1.7.0 and you should use genesis_entry_header with correct priorities. For more information please use the reference links below.

Reference:

  • genesis_after_post_title
  • Genesis 2.0 Hooks reference

Leave a Reply

Your email address will not be published. Required fields are marked *