Hey guys. I am currently struggling with the Query String in a looper. I watched Josh’s video about sorting with URL string parameters and tried to adapt it to my case - without luck (and I think it’s a general understanding issue)
Basically I have a custom archive that needs to pull all posts from a certain post type. These need to be ordered by a meta key (new to old). On top of all the posts, I need a “filter” - meaning that I want a dropdown (or individual buttons) to only show posts from a certain category (acf meta field).
Now - my understanding is that I can build a query like this:
post_type=kunstwerk&posts_per_page=-1&meta_key=kunstwerk_kategorie&meta_value=gemaelde
I tried to use this as a base to test the general function and later exchange the meta value by a url string. But already now it won’t pull all the posts with the key “gemaelde” so I’m stuck. I don’t know if there is a syntax error in my query or something else is wrong.
Also - I find it hard to understand how to build these query strings (I don’t know php). They do make sense to me once I understand the relations. But is there any resource about how to write a query string, what the relations are (e.g. meta_key/meta_value) or is there a way to use the query builder in Cornerstone and have the string somehow be output or grab it from somewhere to use it as a reference?
Thanks guys!
Umberto