0

With the help of User Borek I've managed to get Custom Fields displaying on my siteby putting the below in the functions.php:

function custom_field_before_content() {
if(is_page() || is_single() || is_archive() ) {
    echo genesis_get_custom_field('instrument');}
}
add_action( 'genesis_entry_header', 'custom_field_before_content' );

I'm having trouble putting an id or class on them though so I can style them. I am using a Genesis theme and I can't figure out how to do this. I have tried following this tutorial with no success. Does anyone know where I can put an id or class on these custom fields in a genesis theme?

This is one of the pages where my custom fields are displaying: http://bethlehem-music.org/?p=18. Right above the image and under the title.

Appreciate any help,

Ciarán

1 Answer 1

0

How about just echoing out the needed syntax like that:

echo '<div class="custom-field">' . genesis_get_custom_field('instrument') . '</div>';

You can also just use CSS and style the

header.entry-header {
    //your sexy styles goes here
}

Since other elements inside are wrapped in their own elements and styled separately (I mean the actual H1 and meta data) the only altered item will be the bare custom field value.

2
  • Thanks again Borek I really owe you for this! Appreciate it.
    – Ciarán
    Jan 21, 2014 at 22:09
  • @Ciarán No problem
    – Borek
    Jan 21, 2014 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.