0
<form method="get" action="example.com/?category=1">
    <input type="submit">
</form>

action parameter may be any page etc. but it always redirect to homepage. If I change method to POST - then all fine. What is the problem here?

  • that probably because you already defined a get variable in action ?category=1. – Robert hue Oct 1 '14 at 14:31
  • But this parameters using for linking to category page. How I may access to category page without setting its link in action? – Alexander Oct 1 '14 at 18:48
  • Try the solution here - wordpress.stackexchange.com/questions/12742/… - it might help you, or at least put you on the right track. – Ciprian Apr 25 '18 at 13:47
0

Your permalink structure appears to be incorrect try changing your code to. Modified, try creating a search form like this and see if you still get the homepage, if so then there will be something wrong with your theme templates.

<form method="get" action="/">
    <input type="text" name="s">
    <input type="submit">
</form>
  • As I told in main queston, not important what parameter in action. It may be custom tax or page. But it is always redirecting to home page. If method is POST all fine with any link. – Alexander Oct 1 '14 at 18:51
  • one test is to see if you can create a simple search form, in the same place see if you get your archive template – TTech IT Solutions Oct 1 '14 at 20:08
0

Try the following (untested):

  1. Change your permalink structure in your settings to Post Name.
  2. Try this action if used on a page: action="<?php the_permalink(); ?>"
  3. Or even try to remove the action altogether.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.