zzargo
asked on
Wordpress Search function not Working...
Check out the site: http://snipurl.com/2fq1u-fg44
The sidebar has a search function but it's not working.
I have a custom front page (home.php) that the htaccess is pointing as the main front page.
However, the search function requires the /index.php before it to work (otherwise the search doesn't work... try a random search to see what I mean).
How can I fix this? I.e. allow the search function to append the /index.php into the form action?
See code snippet below.
The sidebar has a search function but it's not working.
I have a custom front page (home.php) that the htaccess is pointing as the main front page.
However, the search function requires the /index.php before it to work (otherwise the search doesn't work... try a random search to see what I mean).
How can I fix this? I.e. allow the search function to append the /index.php into the form action?
See code snippet below.
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
ASKER
I tried that, but that doesn't seem to work... check out the site again. ANy other ideas?
can you hardcode this for checking
<form method="get" id="searchform" action="http://www.acqyr.com/Positive_Affirmations/index.php">
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
<form method="get" id="searchform" action="http://www.acqyr.com/Positive_Affirmations/index.php">
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
ASKER
Hi there,
still doesn't seem to work (give it a try yourself with the new code)
still doesn't seem to work (give it a try yourself with the new code)
it works, can you tell me where you edited the search form?
please create a test.html page and add the below code
please create a test.html page and add the below code
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form method="get" id="searchform" action="http://www.acqyr.com/Positive_Affirmations/index.php">
<div><input type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
</body>
</html>
ASKER
I understand that it should work... but try doing the search yourself on the site to see what I mean. It doesn't append the /index.php to it.
This is a Wordpress install. I put the code in the searchform.php file in the Theme directory.
/wp-content/themes/default /searchfor m.php
This is a Wordpress install. I put the code in the searchform.php file in the Theme directory.
/wp-content/themes/default
modify the searchformp.php
with this code
<form method="get" id="searchform" action="http://www.acqyr.com/Positive_Affirmations/index.php">
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
if you add this i am able to see this in view source
with this code
<form method="get" id="searchform" action="http://www.acqyr.com/Positive_Affirmations/index.php">
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
if you add this i am able to see this in view source
ASKER
That's what I mean... it's there! Identical to what you have pasted.
I have that in the file, but for some reason it's not showing it in the source for me either.
Is there another location that the searchform.php file is called in Wordpress? I don't understand why this doesn't work!
I have that in the file, but for some reason it's not showing it in the source for me either.
Is there another location that the searchform.php file is called in Wordpress? I don't understand why this doesn't work!
ohhhhhhhhh
you are using the default theme only and modifying the searchformp.php page right
just for testing can you rename this page and test
you are using the default theme only and modifying the searchformp.php page right
just for testing can you rename this page and test
ASKER
I renamed it... and it still seems to function but incorrectly... how the heck does that even still work!? It must not be used at all!
Any ideas?
Any ideas?
ASKER
HMm... it's using the Search widget within the "presentation > widget" area of Wordpress
then it is refereing to wrong theme, if i rename searchform.php i get error so it is some thing with theme, please check what theme you have selected
include(/home/fms/public_h tml/wp-con tent/theme s/default/ searchform .php) [function.include]: failed to open stream: No such file or directory in /home/fmspublic_html/wp-co ntent/them es/default /sidebar.p hp on line 6
Warning: include() [function.include]: Failed opening '/home/fms/public_html/wp- content/th emes/defau lt/searchf orm.php' for inclusion (include_path='.:/usr/lib/ php:/usr/l ocal/lib/p hp') in /home/fms/public_html/wp-c ontent/the mes/defaul t/sidebar. php on line 6
include(/home/fms/public_h
Warning: include() [function.include]: Failed opening '/home/fms/public_html/wp-
ASKER
No, it is using the right theme.
The problem is that it is using the Search widget, as explained above... and the search widget doesn't reference the searchform.php file at all.
How can I adjust that?
The problem is that it is using the Search widget, as explained above... and the search widget doesn't reference the searchform.php file at all.
How can I adjust that?
ASKER
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
YES! Thank you! It was actually on line 411 for me... i added the /index.php to it:
<form id="searchform" method="get" action="<?php bloginfo('home'); ?>/index.php">
<div>
<input type="text" name="s" id="s" size="15" /><br />
<input type="submit" value="<?php echo attribute_escape(__('Searc h')); ?>" />
</div>
</form>
And it works!!
Awesome, thanks so much for taking so much time with this! :)
<form id="searchform" method="get" action="<?php bloginfo('home'); ?>/index.php">
<div>
<input type="text" name="s" id="s" size="15" /><br />
<input type="submit" value="<?php echo attribute_escape(__('Searc
</div>
</form>
And it works!!
Awesome, thanks so much for taking so much time with this! :)
glad to help and learn
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>