NO BUG: Query Loop with Happy Files Folder the Meta Query not Working

Browser: Chrome 110
OS: Windows

The image (query loop) above returns 0 results, but I know for sure that one of the in this case PDF’s has post_id 2020. But no results. I’ve searched on the forums but found nothing about this issue. Is this an issue, or am I doing something wrong with querying the HappyFiles Folder.

Thanks

I don’t know happyfiles but i would first try to query all of it and then narrow it down till you only get the one you want.

Gives the option to see when it goes not as expected.

Also try :value and :plain behind {post_id:plain} to remove all other stuff from the dynamic tag

The meta key had to be post_id without the {}. Tried that, still doesn’t work, so this is clearly a bug.

can be i dont know.

I do know if i were to query a:
certain media type,
bound by a mime type, (wrong type is no access)
inside a certain taxonomy,
on a specific post id number, (equal = as is, no more no less)

i better be really sure it’s correct, what i’m querying.

Query Loop – Bricks Academy.

Hi @MauritsDD,

you only want to show one PDF, right? This is not a bug, let me explain why:

It’s because the “post_id” is not actually metadata. If we take a look at one example on my local install, we can see the database looks like:

As you can see, the “post_id” is it’s own column, but the “Meta Query” is only checking the values under “meta_key” column.

So, to only get one post by the ID, you can use a custom query like below:

return [
    'p' => 2020,
    'post_type' => 'any',
];

Please let me know if this works.
Matej

Thanks, that explains a lot, I changed my solution and it now works. Learned something valuable, thank you!

I’m glad that it’s working now :v:.

Best regards,
Matej