I have another thread open for this but posting again for a solution that isn’t necessarily like the one I am having trouble with.
I have a new CPT - Research Papers. I can list them all on a page using template (added as a short code). The template features a Query Loop for that CPT. Easy.
I want to create another page that only lists Research Papers that have a ‘Highlight’ custom field set to True. I’ve tried creating this with Pods and ACF but had luck using a Conditions like this one:
I’ve checked and rechecked the value and tried other ways.
If I use a tag to achieve the same in the Query Loop it works, but I want to use a custom field.
Is this at all possible? Perhaps using a Meta Query?
Since it seems like you want to fetch a list of posts using a query loop a meta query should be your way to go.
Depending on the plugin you are using for your custom fields the value you are comparing to might have to be different. In my case I am using ACF and 1 works as expected. If you are having problems you could try to compare against true or True.
I got it working in context. So, on a post of the same CPT and using the condition on an element.
That must be the issue - I want to display a template on a Page. The shortcode referring to the template works when I display all items but not the condition or meta query.
I too am struggling with this. I have a field that is basically “0 or 1”, or I set it as “Yes or No” and so on. I have tried comparing wit not setting, Equal, Numeric, CHAR - anything that would make sense for the character returned. I have tried pretty much all I can think of in reference to the image in the post above in this thread.
Wen it does work, I only get one post returned even though I have some that should and some that should not be returned.
I definitely want to use the value of a field for this query parameter and not some Category or Tag.
I have tested with more than one WordPress instance, trying a minimalist instance besides the current project. I have tested with Bricks 1.7.3 and 1.8 Beta 2
This isnt working for me. I have a CPT called “Testimonials” with a switch (0/1) for “use in callouts” with field id “callouts” and nothing works in the meta query. I’ve tried every combination of the CF with true/false, 0/1, equal to, not equal to, with brackets, without brackets. Nothing:
I’m using it with Metabox. Not a thing is working. Am I doing something wrong?
without having a look at your exact setup it’s hard to tell what might be wrong in your case. I can only tell that it works as expected if set up correctly (see demo).
If you can provide me with some temporary credentials to your site I’m happy to have a look.