Home › Forums › Support › I need to put beaver builder shortcode in a hook for posts only This topic has 10 replies, 3 voices, and was last updated 7 years, 3 months ago by Tom. Viewing 11 posts - 1 through 11 (of 11 total) Author Posts September 5, 2017 at 12:05 pm #379709 Michael Mancini Hi, Is this possible? A beaver builder shortcode looks like this: [fl_builder_insert_layout slug=”my-post-slug”] How can I put this in a hook that only shows on posts? Thanks, Michael September 5, 2017 at 12:53 pm #379744 Lyle Michael – This should do it 🙂 <?php if ( is_single() ) { ?> <?php echo do_shortcode( '[fl_builder_insert_layout slug=”my-post-slug”]' ); ?> <?php } ?> Cheers! Lyle September 5, 2017 at 1:22 pm #379752 Michael Mancini Hi Lyle, I just tried it and it didn’t work. Michael September 5, 2017 at 1:30 pm #379757 Lyle Did you tick the Execute PHP box? September 5, 2017 at 1:50 pm #379765 Michael Mancini Yes. September 5, 2017 at 1:53 pm #379766 Lyle That’s odd. I just tried it on a test site and it works fine 🙂 Which hook location are you using? September 5, 2017 at 1:54 pm #379767 Michael Mancini I tried Before Footer and After Content. Using this: <?php if ( is_single() ) { ?> <?php echo do_shortcode( ‘[fl_builder_insert_layout slug=”custom-grid-recent-posts”]’ ); ?> <?php } ?> September 5, 2017 at 2:25 pm #379785 Michael Mancini I am getting this error on every page. Image September 5, 2017 at 2:59 pm #379814 TomLead Developer Lead Developer This should be the code: <?php if ( is_single() ) { echo do_shortcode( '[fl_builder_insert_layout slug="custom-grid-recent-posts"]' ); } ?> September 5, 2017 at 3:09 pm #379821 Michael Mancini Hi Tom, That worked. Thanks, Michael September 5, 2017 at 3:12 pm #379824 TomLead Developer Lead Developer You’re welcome 🙂 Author Posts Viewing 11 posts - 1 through 11 (of 11 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In