• Resolved chrismartins29

    (@chrismartins29)


    I would like to make a custom search box for the front page of my website.

    I would like the user to enter a search term in an input box on the front page and then be directed to the job listings page to show the results of the inputted search term.

    Is this possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support vidyakv

    (@vidyakv)

    Hi @chrismartins29,

    Thanks for reaching out to us.

    This can be easily done by adding a custom HTML code. If your theme supports a widget area in the header, you can add the ‘Custom HTML’ widget in the header area and add the below HTML code.

    <form action="https://example.com/job-openings/" method="GET">
    	<input type="text" name="jq" placeholder="Search Job Title" />
    </form>

    Note: The form tag’s action attribute should be the URL to the job listing page.

    The above code won’t retain the searched value within the text box when navigated to the job listing page. So, if you want to retain it, you have to use the PHP code in the appropriate area with the hooks available within your theme or by overriding the template in a child theme. But, please note that this requires basic theme customization knowledge. For example, we are giving an example code snippet to add a job search bar in the header with the popular Astra theme.

    https://gist.github.com/awsm-support/77681e872c57f62375419c01bc1ce127#file-job-functions-php

    Regards,
    Vidya K V

    Thread Starter chrismartins29

    (@chrismartins29)

    That’s great, worked perfectly. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom search box on front page’ is closed to new replies.