Search code examples
wordpressadvanced-custom-fieldsgenesis

Adding Advance Custom Field field in Genesis Framework template


What can I do in order to add an ACF textarea into a Genesis child theme template.

I tried a lot but did not find any way.

Thank you.


Solution

  • First you have to figure out where you want to put the field. You can either use one of the genesis hooks (see here) or perhaps your modifying a theme field directly in which case you can just paste the code whereever you want.

    For example if you're using a hook and you want to put it in your header, you could do something like:

    add_action('genesis_header', 'add_content_to_header');
    function add_content_to_header() {
        echo get_field('my_textarea_field');';
    }
    

    Or do put it directly into a child theme template file, just put this whereever you want:

    the_field('my_textarea_field');';