Everything in my site goes to HTTPS except for one searchbox that insists on using http which gives my site an insecure alert in Chrome. Im using WP 4.9.6 with the Spacious Theme. The search box uses searchform.php and appears to request home_url from there. Both my WordPress URL and my Site URL both contain https://sitename.com.
Here is the content of the searchform.php file:
<form action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>” class=”search-form searchform clearfix” method=”get”>
<input type=”text” placeholder=”<?php esc_attr_e( ‘Search’, ‘spacious’ ); ?>” class=”s field” name=”s”>
<button class=”search-icon” type=”submit”></button>
I have tried to replace home_url with the actual URL including HTTPS, which fixes the page insecure alert, but removes the search box — so that doesn’t seem to work. I reached out to the ThemeGrill folks and they recommended running a plugin to force every http entry to https but that also did not work.
I hope one of ya’ll can point me in the right direction. Im running this locally on a Cent box.
Thanks in advance for your time!
Read more here:: Change home_url in searchform.php to go to HTTPS instead of HTTP