Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14655 reviews 1734 hosting providers

Questions & Answers

WordPress Search only on post pages

Jun 19, 2013 by mike231
I am using a Twenty Twelve child theme and  I am trying to make the search box display on the posts pages only. I used this code in my header.php file
(is_single($post)) : get_search_form();
But this code didn’t work.
Does anyone know how to do this?
Thanks and regards

1 Answer

0 votes
Jun 19, 2013 by WebProX
Try this code
<?php if(!is_page()){ ?>
<?php get_search_form() ?>
<?php } ?>