I am watching this in May 2021 and i copied the code into my site and it works. So simple. It's surprising how convoluted and complicated other solutions are to incorporate the ability to search categories. Thanks for this.
Thanks for creating this tutorial and the accompanying 'Sort Posts Dropdown' too! I have been searching for a simple method to output for example, a grid of categorised images/projects for a portfolio site. Much appreciated 5 years later 😉😁👏👍
Hi, in a similar way how we can add custom post multiple taxonomies terms in the dropdown and then search post for instance Form Filed: Keyword Field Category Dropdown: 1-Select Category a-Category 1 b-Category 2 Custom Post Types Taxonomies: 1-Location a- City Name 1 b- City Name 2 Custom Post Types Taxonomies: 1-Type a- Type 1 b- Type 2
I'm using AJAX Search for WooCommerce for ajax search. I tried this method but the selected category is not showing related posts instead it shows all posts as if it is not working. Please help.
thank u for this video. , sir. plz can u make a video for search by custom post type name, taxonomy and for custom field without search plugin. same like this. plzzzz.....
It's only showing the last three results on the results page.. How do I fix it. The weird part is whenever I don't search in a category, it does show all posts. But when I do search in a category, it only shows three..
Say if I need to list posts on multiple pages each post has two categories (e.g. country & genre or location & price) then how do i go about searching the posts by the both of categories? Also where does that $cat come from?
That's an easy one :) just follow the instructions for excluding categories I show, but don't out a minus sign. So the value will be "3,6" if you want category 3 and 6 together.
$cat is the variable for the category of the current page of post that's displayed. It's like a global variable in the sense that you don't need to declare it, it will have the value of the current page/post if it has one.
+Mikle Rosswell you could just have two select elements in the same form, and it should work. set one select to have options from one category, and the other from the other categories. in theory the query should put them together.
I am watching this in May 2021 and i copied the code into my site and it works. So simple. It's surprising how convoluted and complicated other solutions are to incorporate the ability to search categories. Thanks for this.
Thanks for creating this tutorial and the accompanying 'Sort Posts Dropdown' too! I have been searching for a simple method to output for example, a grid of categorised images/projects for a portfolio site. Much appreciated 5 years later 😉😁👏👍
I really enjoyed this... thank you so mush... was trying to figure this out for over a month.
Thanks for a straight-forward, useful video on a nice WordPress feature. Just what I was looking for.
Bless you for making this video ❤
Perfect tutorial
As you say: Brilliant!
Great tut! Just what I needed to learn. Thanks!
exactly what i needed
thank you for this amazing video.
Thank you!
thanks a lot
Great man, thanks you so much. Can I make more than one?
Hi, in a similar way how we can add custom post multiple taxonomies terms in the dropdown and then search post for instance
Form Filed:
Keyword Field
Category Dropdown:
1-Select Category
a-Category 1
b-Category 2
Custom Post Types Taxonomies:
1-Location
a- City Name 1
b- City Name 2
Custom Post Types Taxonomies:
1-Type
a- Type 1
b- Type 2
I'm using AJAX Search for WooCommerce for ajax search. I tried this method but the selected category is not showing related posts instead it shows all posts as if it is not working. Please help.
thank u for this video. , sir. plz can u make a video for search by custom post type name, taxonomy and for custom field without search plugin. same like this.
plzzzz.....
What if we want the dropdown option under the search and not beside it?
can you plz tell how to get rid of the default search bar and have only a search icon there , I'm using 2017 theme. it would be great help.
how filter by multi taxonomy admin?
Can you guide this function?
thanks admin
It's only showing the last three results on the results page.. How do I fix it. The weird part is whenever I don't search in a category, it does show all posts. But when I do search in a category, it only shows three..
Thank you for this tutorial! Sadly the source code is not available anymore
Sorted :)
Say if I need to list posts on multiple pages each post has two categories (e.g. country & genre or location & price) then how do i go about searching the posts by the both of categories?
Also where does that $cat come from?
That's an easy one :) just follow the instructions for excluding categories I show, but don't out a minus sign. So the value will be "3,6" if you want category 3 and 6 together.
$cat is the variable for the category of the current page of post that's displayed. It's like a global variable in the sense that you don't need to declare it, it will have the value of the current page/post if it has one.
Wow you were quick to respond too. I'll return here again tomorrow and likely in the future. Muy apreciado!
I meant two separate search fields on the page. Will take another look at the video.
+Mikle Rosswell you could just have two select elements in the same form, and it should work. set one select to have options from one category, and the other from the other categories. in theory the query should put them together.
I get an error on almost every line when adding to code snippets. I have tried this on two different templates. This code must not work anymore.
Have any New Method after 6 years...
does this still work in 2019?
Yes, it does.
yep bro
@@webbrandproton2165 It looks pretty straight forward, thanks.
Thank you!