Timeline for Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 18, 2021 at 11:29 | comment | added | Sally CJ | Hi @TheChewy, that's a "cute"/nice website! :) And in reply to your question, yes, that's correct. But instead of repeating that second code, you might want to put the code in a function like this - that way, your code would be simpler and easier to maintain. =) Happy coding! | |
Mar 17, 2021 at 19:57 | vote | accept | pjk_ok | ||
Mar 17, 2021 at 19:57 | comment | added | pjk_ok | Hi @SallyCJ it does work now. You can see it here marketing-people.com/jobs Also in the future if I ever need to add a third taxonomy will I just add the name of the taxonomy to the array() in the first block of code, then amend the $taxonomy variable in the second block of code which goes into the form? | |
Mar 17, 2021 at 3:34 | comment | added | pjk_ok | Hi @SallyCJ I think I've found the problem - I think it's a conflict with some other code on the site. I'm pretty sure it will work now but will have a proper look tomorrow and then mark as correct etc. I can't thank you enough for your help thus far. | |
Mar 16, 2021 at 8:29 | comment | added | Sally CJ |
Hi Emily, sorry for the late reply.. So have you managed to fix the "disabled" issue? Are you sure you actually used wpse_384435_checklist() and not wp_terms_checklist() ? Can you show your form code?
|
|
Mar 9, 2021 at 22:53 | comment | added | pjk_ok | Thanks @SallyCJ. When I add the new code I only get the salary levels showing snipboard.io/FxyPw8.jpg and the checkboxes have the disabled attribute added snipboard.io/HEbCOx.jpg (the checkboxes are also disabled if I only add the 'salary_level' code in the form on the front end and don't add the 'jobs_categories' at all). | |
Mar 5, 2021 at 9:36 | comment | added | Sally CJ |
Hi Emily :) I've revised the answer, so please try the new/updated code - the wpse_384435_checklist() and my_search_pre_get_posts() functions.
|
|
Mar 5, 2021 at 9:33 | history | edited | Sally CJ | CC BY-SA 4.0 |
deleted 238 characters in body
|
Mar 5, 2021 at 0:22 | comment | added | pjk_ok |
hi @SallyCJ thanks ever so much for this. In the 1st example the checkboxes are disabled & have the disabled="disable" attribute added? The 2nd example doesn't have this. There is one other issue which is completely my fault (sorry) which is that I will also have another taxonomy list for job types which is jobs_categories . I added the form code above for a 2nd taxonomy and changed the $taxonomy variable (which does show as expected in the frontend). I can't work out how to the amend the functions.php code though to get it work (this comment is in relation to the 2nd example in your answer)
|
|
Mar 4, 2021 at 9:46 | history | answered | Sally CJ | CC BY-SA 4.0 |