Site logo

Archived topic

Hooking custom content after the comments section

3 replies · Started by Joona on April 12, 2017

Viewing posts 1–4 of 4

GeneratePress doesn't seem to have a custom hook after the comments field. Is there a general WordPress hook I could use, and if so, how?

I need to insert a YouTube video after the comments field on single blog posts.

I was able to insert the code to the right place, but I still need to make it conditional so that the code is shown only on single posts.

Something like this should do it:

add_action( 'generate_after_main_content','tu_after_main_content' );  
function tu_after_main_content() { 
    if ( ! is_single() ) { ?> 
        Your Youtube video here
    <?php }
}

Adding PHP: https://docs.generatepress.com/article/adding-php/

This archived topic is closed to new replies.