NO BUG: Query Loop Meta Query

Bricks Version: 1.5.7
Browser: Chrome 90
OS: macOS / Windows / Linux / etc.

Hi,
I came from Elementor…
So, I just can’t do nothing with Meta Query… For example, just list the post with a specific ID.
There is any documentation, or can some one explain to me what is expected to place in meta key and meta value.

What is wrong with this?
Captura de ecrã 2022-11-12, às 19.23.50

Hi Fausto,
Welcome to the forum, and thanks for reaching out!

The meta query queries metadata (aka custom fields). Since the post id needs to be set in the post/page parameters of the query, it doesn’t work.

You can easily include your desired post using the “include” setting in the main loop settings:
image

Best regards,
timmse

Reference:

Hi,
Thanks for the reply.
The include field only can be set in Bricks, and I need a dynamic field. The post ID will be in a ACF custom field were the user (that can’t access to bricks) have to select the post.
Thanks for your help. I’ll try your references.
I think you should improve the meta query documentation.
Best regards

Right now you have to use a hook for that:

I am also trying to do something similar.

I am trying to achieve a nestable slider query loop for recommended products, so I have set up a custom field checkbox ‘recommended’

Screenshot 2023-03-13 at 08.12.41

Ive tried 1, ive tried EQUAL but nothing is being rendered on the frontend.

Is this a bug, @timmse, or am I doing something wrong?

Thanks

Hey Mike,
What kind of checkbox is it (ACF, metabox, …, custom)?

Are you sure both the meta key and the meta value is correct? To make sure, you can take a look at the database and see how the key and value are stored.

Maybe it would be worth a try to use “LIKE” instead of “IN”.

1 Like

[SOLVED]
I’m using ACF.

LIKE worked! Brilliant, thanks @timmse!

1 Like