Timeline for WordPress Custom Search by post_type
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 19, 2011 at 0:57 | vote | accept | php-b-grader | ||
Nov 18, 2011 at 6:17 | comment | added | andresmijares | I think that function can help you, if not, I'm done =( | |
Nov 18, 2011 at 6:16 | history | edited | andresmijares | CC BY-SA 3.0 |
added 48 characters in body
|
Nov 18, 2011 at 6:08 | comment | added | php-b-grader | I have installed the Job Manager plugin. It creates a page on /jobs. from this page, I want to search only post_types = jobman_job. I am not using pages for anything else at the moment but can't say that will always be the case. | |
Nov 18, 2011 at 6:01 | comment | added | andresmijares | do you have others post type? or just looking to display post and pages? | |
Nov 18, 2011 at 5:55 | comment | added | php-b-grader | didn't actually work... I hadn't removed the code from search.php so it was showing the right results but using search.php... | |
Nov 18, 2011 at 5:48 | comment | added | andresmijares | way to go :)! glad it worked | |
Nov 18, 2011 at 5:46 | vote | accept | php-b-grader | ||
Nov 18, 2011 at 5:54 | |||||
Nov 18, 2011 at 5:46 | comment | added | php-b-grader | Working now - I copied search.php to job-search.php...Changed the form action to /job-search.php...Added your code above and it is now working as expected | |
Nov 18, 2011 at 5:43 | comment | added | andresmijares | use the form I typed before, and then make a conditional that display this code if post_type, or maybe create an extra search class and call it in the action of your form... I don't see ur escenario so I cannot be that helpful :) | |
Nov 18, 2011 at 5:38 | comment | added | php-b-grader | Ok... That works but it works across all searches! I am trying to have a custom search on the /jobs page that only searches for jobman_job post_type's - every other search should search all posts... | |
Nov 18, 2011 at 5:32 | comment | added | andresmijares | just edited the answer... worked perfect for me | |
Nov 18, 2011 at 5:32 | history | edited | andresmijares | CC BY-SA 3.0 |
deleted 398 characters in body
|
Nov 18, 2011 at 5:22 | comment | added | php-b-grader | The only difference appears to be that you've made the value a select value instead of a hidden value - still gives the same result - shows all posts regardless of type... | |
Nov 18, 2011 at 5:12 | history | answered | andresmijares | CC BY-SA 3.0 |