Title: Hook on Single Posts
Last modified: May 19, 2018

---

# Hook on Single Posts

 *  Resolved [Ahmet ALMAZ](https://wordpress.org/support/users/music47ell/)
 * (@music47ell)
 * [8 years ago](https://wordpress.org/support/topic/hook-on-single-posts/)
 * 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/](http://demo.generatepress.com/hook-locations/)
 * Thank you
    -  This topic was modified 8 years ago by [Ahmet ALMAZ](https://wordpress.org/support/users/music47ell/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhook-on-single-posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [8 years ago](https://wordpress.org/support/topic/hook-on-single-posts/#post-10299992)
 * 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](https://wordpress.org/support/users/music47ell/)
 * (@music47ell)
 * [8 years ago](https://wordpress.org/support/topic/hook-on-single-posts/#post-10300311)
 * Hi Tom,
 * This worked perfectly. Thank you so much.
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [8 years ago](https://wordpress.org/support/topic/hook-on-single-posts/#post-10302297)
 * You’re welcome 🙂

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

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

 * ![](https://i0.wp.com/themes.svn.wordpress.org/generatepress/3.6.1/screenshot.
   png)
 * GeneratePress
 * [Support Threads](https://wordpress.org/support/theme/generatepress/)
 * [Active Topics](https://wordpress.org/support/theme/generatepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/generatepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/generatepress/reviews/)

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/edge22/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/hook-on-single-posts/#post-10302297)
 * Status: resolved