WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have custom search form on category category.php list template with following code:

<?php $searchresults = site_url('/?p=1365'); ?>

<form class="search-slide" id="search-slide" name="search-slide" action="<?php echo $searchresults; ?>" method="post">
    <input type="text" name="s_name" id="s_name" size="30" value="" class="find s-name" placeholder="Name Lastname" tabindex="1" />
    <input type="text" name="s_offer" id="" size="30" value="" class="find s-tag"  placeholder="in research offer" tabindex="2" />
    <input type="text" name="s_area" id="" size="30" value="" class="find s-obsz"  placeholder="in Application area" tabindex="3" />
    <input name="s_tags" id="tag-list" value="" tabindex="4" />

    <input class="slideradio" type="checkbox" id="w01" name="w[]" value="w01" />
        <label for="w01"><span></span>Faculty of Architecture</label>
    <input class="slideradio" type="checkbox" id="w02" name="w[]" value="w02" />
        <label for="w02"><span></span>Faculty of Civil Engineering</label>
    <input class="slideradio" type="checkbox" id="w03" name="w[]" value="w03" />
        <label for="w03"><span></span>Faculty of Chemistry</label>

    <input class="slideradio" type="radio" id="adefault" name="s_sort" value="" checked="checked"  tabindex="6"/>
    <label for="adefault"><span></span>Default</label>
    <input class="slideradio" type="radio" id="aasc" name="s_sort" value="" tabindex="7" />
    <label for="adefault"><span></span>Sort A-Z</label>
    <input class="slideradio" type="radio" id="adsc" name="s_sort" value="" tabindex="8" />
    <label for="adefault"><span></span>Sort Z-A</label>

    <button id="slide_search_btn" type="submit">Search</button>

And I'd like to send variables into another wordpress website search-result.php (template page is added and published in dashboard). But when I click Search button I get error 404 (I have red about naming name fields but I think mine are Ok). But when I enter page directly in browser I got page normally. Can anybody direct me how to resolv this problem?

share|improve this question
w is a reserved name. Try renaming it. – toscho Aug 2 '13 at 11:47
Thanks for answer, just checked (renamed to: searchfaculty[]) it, nothing changed. – Marcos Aug 2 '13 at 11:51
@Marcos: Not in your question here. Also there are more reserved names, as you didn't check for that one, it's sometimes likely you've done the same error elsewhere as well (that's just a trick in trouble-shooting I'm trying to tell here, I don't know if that is your issue nor want I say that you didn't do that). – hakre Aug 2 '13 at 12:15
Please answer your question in the answer field, not in the question. – toscho Aug 2 '13 at 12:41
up vote 0 down vote accepted

I found solution: IF you're using permalinks you have to use get_permalink() function:

 <?php $searchresults = site_url('/?p=1365'); ?>

change to

<?php $searchresults = get_permalink( 1365 ); ?>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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