Home › Forums › Support › Search box for blog post This topic has 9 replies, 2 voices, and was last updated 6 years, 3 months ago by Leo. Viewing 10 posts - 1 through 10 (of 10 total) Author Posts January 20, 2018 at 3:50 am #475484 Giacomo Hello, i need to add search box for BLOG POST in GP hooks like this or like this can someone help me with the code please? January 20, 2018 at 8:53 am #475720 LeoStaff Customer Support Hi there, Try: <?php if ( is_single() ) { get_search_form(); } ?> January 21, 2018 at 12:34 am #476114 Giacomo okay, i try but don’t work January 21, 2018 at 5:33 am #476244 LeoStaff Customer Support Did you check Execute PHP? I just tried the exact code in hooks and it worked. January 21, 2018 at 5:43 am #476254 Giacomo i try to copy the code in hook but search box don’t appears January 21, 2018 at 5:48 am #476263 LeoStaff Customer Support Which hook is that? can you link me to the page? January 21, 2018 at 6:07 am #476267 Giacomo i try copy the code in: – after header hook and – inside content container hook https://grement.com/ January 21, 2018 at 2:06 pm #476635 LeoStaff Customer Support That’s the main blog page, not single posts. Try this instead: <?php if ( is_home() ) { get_search_form(); } ?> More info here if you are interested: https://docs.generatepress.com/article/using-hooks-conditional-tags/ January 21, 2018 at 11:33 pm #476798 Giacomo sorry man, now it works perfectly but if I need to view this in all the pages? January 22, 2018 at 6:48 am #477028 LeoStaff Customer Support To show on all pages? You can just remove the conditional tag: get_search_form(); 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