How to add a piece of HTML after content Genesis theme

I'm working with a project using a Genesis theme. I've created a child theme and wanted to add a piece of HTML after the content but sadly the genesis_after_content hook doesn't work.

I'm running Wordpres 5 on PHP 7 and I've tried increasing the priority to 99 but still doesn't work.

add_action( 'genesis_after_content', 'sample_after_content' );
function sample_after_content() {
     echo '<h1>Hi there!</h1>';
}

and it doesn't do anything.

1 answer

  • answered 2019-01-11 08:27 Sandy J

    When you say after the content, does it mean after everything you have in the default wysiwig editor in post and pages? Do you want to have this HTML snippet on all pages by default or on specific ones? Does that include pages and post or just one of them?

    You can go to the template itself for default page or post and add it. If its specific page, you can use ACF (advance custom fields) to create a custom snippet to insert on various pages / post etc.

    If you can provide some details, I can provide a specific solution.