I am trying to:
Search custom fields within views for a custom post. The custom post and custom fields were not created with types.
Link to a page where the issue can be seen:
I expected to see:
The posts information with filters applied.
Instead, I got:
The posts appear, but all of them, with no filter.
Hello,
Please elaborate the question with more details:
How do you setup the custom fields?
What field slug is it using? is it a private field? the field slug is start with "_"?
How do you want it to setup in the view's filter?
If it is a private field, the field slug is start with "_", you can show it in the Views GUI, by this:
Dashboard-> Toolset-> Settings-> Front-end Content,
click button "Select custom fields", find and enable the private field, then you will be able to add it in the Views query filter.
How do you setup the custom fields?
I created them with the pods plugin, I'm building a site for a company to sell houses. I want the users to be able to search for a property that have a type(apartment, house,etc), a location (state, city, neighborhood) and value (range >50000, >100000, etc).
What field slug is it using? is it a private field? the field slug is start with "_"?
All the fields were created with the name of the field, then _, then the word imovel. ex: "tipo_imovel","uf_imovel","municipio_imovel".
How do you want it to setup in the view's filter?
I want to setup the filter in the same page as the query. The user select the parameters in the search with several dropdown lists, and then click to search. After the search the list of realty states properties are updated for the parameters selected.
If it is a private field, the field slug is start with "_", you can show it in the Views GUI, by this:
Dashboard-> Toolset-> Settings-> Front-end Content,
click button "Select custom fields", find and enable the private field, then you will be able to add it in the Views query filter.
I was able to add them in the query filter. The problem was that the filters were not working. I had two custom posts marked as houses and one marked as a apartement. When I filtered just by the apartment type, all three showed on the loop.
For the question: The problem was that the filters were not working
It depends on how does the pods plugin store the custom fields values, I suggest you use some MYSQL tools, check it in your database, find the custom fields value: "tipo_imovel","uf_imovel","municipio_imovel".
Then setup the custom field filter in view by following our document:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
Filtering Views Query by Custom Fields