• Resolved Ahmet ALMAZ

    (@music47ell)


    Hi,

    How can I make this function work only on single posts?

    add_action( 'generate_after_entry_title','function_name' );  
    function function_name() { ?>
    Some text and scripts
    <?php }

    And this page isn’t working anymore:

    http://demo.generatepress.com/hook-locations/

    Thank you

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    Give this a shot:

    add_action( 'generate_after_entry_title','function_name' );  
    function function_name() { 
        if ( is_single() ) : 
            ?>
            Some text and scripts
            <?php
        endif;
    }

    Let me know 🙂

    Thread Starter Ahmet ALMAZ

    (@music47ell)

    Hi Tom,

    This worked perfectly. Thank you so much.

    Theme Author Tom

    (@edge22)

    You’re welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hook on Single Posts’ is closed to new replies.