Home › Forums › Support › How to add link to post on the title in page hero? This topic has 9 replies, 3 voices, and was last updated 3 years ago by Tom. Viewing 10 posts - 1 through 10 (of 10 total) Author Posts January 24, 2020 at 4:41 pm #1143134 Ahmed Eid How to add link to post on the title in page hero? I tried to add this code to add the link on the headline: add_filter( 'generate_page_hero_post_title', function( $title ) { if ( is_single() ) { $title = the_title( sprintf( '<a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a>' ); } return $title; } ); It works but outside the page hero framework. January 25, 2020 at 6:55 am #1143727 DavidStaff Customer Support Hi there, what would be the purpose of adding the link to the post that is currently being displayed? Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ January 25, 2020 at 1:39 pm #1144059 Ahmed Eid I used to use it on my sites January 25, 2020 at 3:20 pm #1144116 DavidStaff Customer Support Can you link me to a post where i can see the problem? Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ January 27, 2020 at 10:19 am #1146002 Ahmed Eid The title appears outside the page hero January 27, 2020 at 3:23 pm #1146240 TomLead Developer Lead Developer Can you try this code, instead?: add_filter( 'generate_page_hero_post_title', function( $title ) { if ( is_single() ) { $title = the_title( sprintf( '<a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a>', false ); } return $title; } ); Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ Ongoing Development: https://generatepress.com/ongoing-development January 29, 2020 at 3:18 am #1147974 Ahmed Eid Thanks, Tom But The headline has disappeared after using the code January 29, 2020 at 9:21 am #1148427 TomLead Developer Lead Developer Sorry about that, can you try this?: https://generatepress.com/forums/topic/how-to-add-link-to-post-on-the-title-in-page-hero/#post-1146240 Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ Ongoing Development: https://generatepress.com/ongoing-development January 29, 2020 at 12:09 pm #1148596 Ahmed Eid I am happy Thank you so much “Tom” good job January 29, 2020 at 4:09 pm #1148722 TomLead Developer Lead Developer Glad I could help 🙂 Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ Ongoing Development: https://generatepress.com/ongoing-development Author Posts Viewing 10 posts - 1 through 10 (of 10 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In