• I have a wordpress page which has introductory paragraph and a sidebar which contains a list of projects (custom post type) and I have created a form above it which i want to be able to enter search criteria (based on the custom post fields) and then on clicking submit the page will refresh and hence show a subset of results. However the form never submits to the “page” and instead insists on posting to one of the custom posts instead.

    Please could anyone point me in the direction of what i am doing wrong

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sounds like you don’t have the form’s action attribute set correctly but its hard to say without seeing the relevant code.

    Thread Starter Steveccc

    (@nickthorley)

    The search form is below. The form is contained within a wordpress page which has the url blog/page-project/

    However when i hit search I am directed to the page url below – where project-2 is a custom post type rather than a page. I simply want the search to return to the same page.

    /project/project-2/?contractperiod=sg&post_type=project&searchsubmit=Search

    <form id=”searchform” action=”” method=”get”>
    <input id=”contractperiod” maxlength=”6″ name=”contractperiod” size=”6″ type=”text” value=”” class=”txt” />
    <input name=”post_type” type=”hidden” value=”project” />
    <input id=”searchsubmit” name=”searchsubmit” class=”btn” type=”submit” value=”Search” />
    </form>

    Thanks

    Nick

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘creating a custom post search’ is closed to new replies.