• Hi all!

    First post on WP.org, wihoo!

    I need help to remove the function of “search results page” when using the search function.

    I want the function of the searchbar to be like this:

    User put in search text etc “0084”, hits enter.
    Searchbar should be redirecting to “productpage” of id 0084, not the result page with 0084.
    If there’s no id “0084” it would show “no results found page”.

    Many thanks in advance!
    BaronJones

    • This topic was modified 3 years, 11 months ago by baronjones.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • <form onsubmit="window.location = '<?php echo $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME']; ?>/productpage/' + search.value; return false;">
    <input id="search" placeholder="Search" type="search" name="search"></input>
    <input type="submit" value="Send">
    </form>

    Obviously change what you need. You’re not actually using WP search but rather just redirecting to a page so don’t use native WP search for this.

Viewing 1 replies (of 1 total)
  • The topic ‘Customize search function’ is closed to new replies.