Search code examples
phpwordpressadvanced-custom-fieldsgenesis

How to add advance custom field just after the post


I am using Genesis framework and I want to add advance custom field just after the post, I did some code but the field is not coming just after the post.

Here is the code:

add_action('genesis_entry_content', 'add_content_after_content');
function add_content_after_content() {
    echo '<div class="tips-text-image">';
    echo '<img src="' . get_field('image') . '">';
    echo the_field('text');
    echo '</div>';
}

Solution

  • You can use this http://genesistutorials.com/visual-hook-guide/ or install this plugins on your site https://wordpress.org/plugins/genesis-visual-hook-guide/

    You can add extra content after content on this hooks.

    add_action('genesis_entry_footer', 'after_new_content');
    add_action('genesis_after_entry', 'after_new_content');
    add_action('genesis_after_endwhile', 'after_new_content');
    add_action('genesis_after_loop', 'after_new_content');
    add_action('genesis_after_content', 'after_new_content');
    add_action('genesis_after_content_sidebar_wrap', 'after_new_content');
    function after_new_content(){ echo 'new content'; }