Timeline for How to create a custom search for custom post type?
Current License: CC BY-SA 4.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 5, 2022 at 10:24 | comment | added | Periklis Kakarakidis | For an answer being written 9 years ago, I can confirm in 2022 that it still works and with great accuracy! Excellent work @Ronald you are amazing! | |
Mar 31, 2021 at 14:07 | history | edited | Ronald | CC BY-SA 4.0 |
spelling mistake
|
Feb 2, 2021 at 4:02 | comment | added | Cypher | The above code worked for me. I just needed to edit <?php the_exerpt(); ?> and change it for <?php the_excerpt(); ?> | |
S Oct 8, 2020 at 14:47 | history | suggested | user10684 | CC BY-SA 4.0 |
prevent XSS
|
Oct 8, 2020 at 13:30 | review | Suggested edits | |||
S Oct 8, 2020 at 14:47 | |||||
Jul 19, 2018 at 13:02 | comment | added | Alexey Kosov |
the search_template filter seems to be a more appropriate alternative to template_include
|
|
S Apr 4, 2018 at 12:07 | history | suggested | MohammadHossein R | CC BY-SA 3.0 |
File name is different from what is mentioned in code and doesn`t work this way
|
Apr 4, 2018 at 11:08 | review | Suggested edits | |||
S Apr 4, 2018 at 12:07 | |||||
Dec 13, 2017 at 10:42 | history | edited | Ronald | CC BY-SA 3.0 |
added 1 character in body
|
S Nov 19, 2017 at 18:32 | history | suggested | Marcello B. | CC BY-SA 3.0 |
formatting and grammar
|
Nov 19, 2017 at 16:00 | review | Suggested edits | |||
S Nov 19, 2017 at 18:32 | |||||
Nov 13, 2017 at 11:20 | comment | added | Ronald | @YarGnawh Sorry for late response, check this out wordpress.stackexchange.com/questions/15418/…. There is a plugin called rewrite too wordpress.org/plugins/rewrite | |
Nov 6, 2017 at 16:33 | comment | added | YarGnawh |
is there a way to rewrite the url from http://localhost:3000/?s=cloud%27&post_type=product to http://localhost:3000/search/cloud/product
|
|
Apr 8, 2016 at 15:51 | comment | added | indextwo |
Another tip/suggested edit: get_query_var('post_type') returned an array (rather than a string) so couldn't be compared directly. Since I'm only searching one post type at a time, I simply changed my $post_type var to $post_type[0] .
|
|
S Aug 14, 2015 at 14:28 | history | suggested | BlueberrySourRaspberry | CC BY-SA 3.0 |
Code was not complete. had syntax errors and missing endwhile / endif
|
Aug 14, 2015 at 13:10 | review | Suggested edits | |||
S Aug 14, 2015 at 14:28 | |||||
May 21, 2015 at 17:46 | comment | added | Gustavo Daniel | Tip: when registering the post type, the publicly_queryable argument must be set to true. If not, the get_query_var('post_type') will never return the post_type value given in the url argument. codex.wordpress.org/Function_Reference/… | |
Jan 29, 2015 at 9:52 | history | edited | Ronald | CC BY-SA 3.0 |
edited body
|
Mar 10, 2013 at 14:54 | vote | accept | robert | ||
Mar 13, 2013 at 19:03 | |||||
Mar 8, 2013 at 9:09 | history | edited | Ronald | CC BY-SA 3.0 |
added 99 characters in body
|
Mar 8, 2013 at 9:04 | history | answered | Ronald | CC BY-SA 3.0 |