In need of real indepth tutorial of the Query/Filter blocks using custom post type, custom taxonomies and ACF

Dear Cwicly team and community,

I have been spending 3 days trying to make the query and filter blocks work for a custom post type filtering through custom taxonomies and ACF fields, all with mainly no luck!
I was sometimes arriving close but never managed to make it work. Often even running into unresponsive pages on the front end.

Also, I have been trying to find ways to register Query classes in order to get something like provided by Woocommerce in @Louis live video about the filter blocks, thinking that might help using the query block. But I am not sure how to do so. If anybody knows a good resource for that, I am all hears!

Anyway, not sure where I get the logic wrong but I think we are quite a few in need of real explanation of the logic and best implementation of the Query/Filter blocks with real life examples that are not WooCommerce ones.

Sorry if it sounds too basic, I have been following a lot of ressources regarding the WP_Query , WP_Meta_Query etc… but I still haven’t been able to achieve any working solution.

Thank you in advance!!

1 Like

@weedor @Gary and anyone else in need of a simple tutorial of the Query/filter blocks using post and category
Louis made one here

I detailed the problem I am facing in another thread.

2 Likes

I am always found of tutos of Cwicly!

1 Like

This request is a few months old, but this is still lacking, in my opinion.

The Filter block deserves a LOT more explanation. We need more documentation, tutorials, how-tos. Clearly it is extremely powerful, but I can’t get it to do all the things that Louis has demoed in his original video. I just don’t know how. Currently, I’ve tried on a number of occasions, but cannot get a range slider to work for my project. All the (very few) references are Woocommerce applications, which is not what I need.

Having all the features, but not knowing how to use them is frustrating. Please, we need more documentation on this.

2 Likes

Hi @owynter,

Sorry to hear about this.

We will try to provide more thorough documentation on filtering as soon as possible.

In the meantime, I would be more than happy to provide a short video on setting up a range slider.
What application would you like to see it in?

Thank you in advance.

Thanks for offering. I am simply using ACF fields, so I need to be able to do range sliders for Meta Queries. But this has proven difficult. In my application, it is for a price field.

Beyond that, I would like to know how to create filters for ordering by Meta Query eg. order by price: high-low, order by bedrooms: high-low, etc. I also want to be able to do a count (X items found). See below what I’m trying to create.

The other dropdowns are simple enough, but I need help with the ones I have mentioned above.

I’m sure many others struggle with them, and I would love to do tutorials, but I simply don’t know how.

2 Likes

Hi there @owynter,

What is proving to be difficult exactly?
Is it the query setup? The slider range setup?

The custom meta key ordering is not currently implemented with the Filter as it requires a bit more logic which we’re still working on.

Thanks for clearing it up.
Araminta’s video helped greatly, and I’m able to get the range slider working. I did add a couple of issues I am now experiencing when it comes to adding larger steps to the slider. I’ve included a video showing the issue.

You can also check my implementation here.

How do we add the Post Count filter? Or is this not currently possible either?

As I’ve been experimenting with the filters more and more, it’s starting to make sense, after many hours or testing.

The “User Selection” option seems promising. Could this logic be used to return the Post count as I was asking above?

I was getting ready to post this as a new topic but found yours so I am adding it here instead

Subject: Assistance Needed with Query Editor and Request for In-Depth Video Tutorials

Hello Cwicly Peeps,

I am reaching out with an urgent request for guidance on the Query Editor. Despite diligently studying all available documentation and resources, I find myself consistently struggling with queries, often spending days attempting every combination imaginable without success. For instance, I am currently trying to create a meta filter for a custom post type (CPT) radio button, where the value is ‘1’ for “Yes” and ‘0’ for “No”. Unfortunately, I am unable to determine the correct settings for the Meta Query in this scenario.

Could someone kindly provide the exact settings needed for this specific case? This would save me invaluable time and significantly reduce trial and error.

Additionally, I believe that comprehensive video tutorials covering various scenarios in the Query Editor would be highly beneficial for many users like myself. This aspect of Cwicly is foundational, and more detailed guidance would greatly enhance our ability to utilize the platform effectively. @StrangeTech

Hi @ShannaKae,

maybe this helps:

As far as I know the comparison is run in php and without strict comparison false, 0, 0.0, "" are not as easy to compare to direct values.

I am planning some query tutorials, but that still takes a little time.

Cheers

Ok so i am fairly new here, are you suggesting that I can use the visibility feature (the eyeball on the top left of the UI area on the right) for this part instead of using the query? Please forgive me if that is a obvious thing, as i am new I am still figuring things out. And if this is a workflow would i run it on the query block itself or the query template or the individual Div?

Also, i can set up the value and Labels to whatever works best. Originally i had them set to yes and Yes and no and No, but i switched it to 1 Yes and 0 No, thinking that might work better.

I dont write or read code either, but i can copy past Like a Boss and I am slowly learning and understand the overall concepts. Keep this in mind as you respond to me. Thanks so much!!!

Hi @ShannaKae,

no worries, even though I’ve been playing with Cwicly for quite a while, I would consider myself only a little more than a beginner :smiley:

I’m not sure what your current state is.

I can’t really help you with the filters, as I’ve been trying to avoid the toppic myself for some time.

As for the visibility condition of my example, it was just an example of how we don’t have the same options everywhere.

It might be possible to use the visibility options depending on your situation.

Since I think you want to use a query to show some data of posts, I would use the meta query.

And in your case I would probably go with

since the comparison is less prone to errors from the user.

Cheers

p.s. don’t forget to resave your posts when changing your acf field group radiobutton.

Thank you so much for your help, unfortunately i followed exactly those steps and it did not work. I also tried it with a True False toggle button with the sam non results… I really appreciate your trying! Let me tag a couple of the devs and hopefully they can jump in here to help! @Araminta @Louis Thanks so much T-low!

Hi @ShannaKae,

are you using a query to display post data, or are you using something else?

Here a short one, how I set up the provided example:

Cheers

Hey thank you!, I have done this exactly but with a post type. Hang on I will take a screencast of my setup so you can see, maybe i am missing something.

Hey here is my screencast showing my setup. I am dumbfounded. : ) Edit Page “Search” ‹ ICID — WordPress - 2024-02-19_14-31-10 - TechSmith Screencast - TechSmith Screencast

Hi @ShannaKae,

two things, you are using the ACF field key, and im not exactly sure where the difference precisely lyes, but as far as i know, Cwicly compares the field name.

grafik

So try switching that.

The second thing is that you are useing true and false instead of

That’s perfectly fine, by the way, but in some ways not foolproof!

As already mentioned here Check for empty field in meta query and other true and false are values that php registers and are not easily (foolproof) comparable. While true still works in most cases, false may need to be compared diffrently, for example with empy.

So if you would like to go with true and false, use this for false:

grafik

and this for true:

grafik

And the part about profile and profiles is most likely your post type definition and nothing to worry about.
I personally always use either the plural or the singular for both values for all post types.

grafik

Hope this helps

Cheers

Life Saver!!! That was it, i was using the field key not the name. Yayayaya. Thank you sooooo much. Have a great day. And thank you for taking time out of your day to help me that was really nice of you.

1 Like