Got this Query that has a Meta Query - looks for the Meta Key (static) and the Meta Value dynamically (WordPress > Post ID)
Thing is it doesn’t seem to wok using the dynamic method - ignores the Meta Query completely and returns straight list of latest posts
BUT - when I change to Meta Value to “Static” and manually type in a Post ID I get the correct set of posts listed.
Any pointers here guys?
// The Arguments
$args = array (
0 => 'post',
'posts_per_page' => 2,
'ignore_sticky_posts' => true,
'key' => 'database_mentions',
'value' => '""',
'compare' => 'LIKE',
'type' => 'CHAR',
'title' => 'database_mentions',
'orderby' => 'date',
'order' => 'DESC',
// The Query
$the_query = new WP_Query( $args );
Could you describe in more detail what it is exactly that you want to achieve? So what posts with what characteristics should be displayed where.
As per the screen shot / generated Cwicly code @Jonas :
Using a static Post ID works, using dynamic to pull in Post ID in the query does not.
Ok, maybe a bit too complex for me – I’m pretty new here, sorry.
no worries @Jonas - appreciate your attention
Thanks for posting this and sorry for the trouble.
I can confirm that there is an issue when trying to compare with an integer value in this specific case as the Post ID is being returned as a string.
We’ll have this fixed in the next update.
Apologies once again for the inconvenience.
Moving to bugs.
This should be addressed in 126.96.36.199.
If you sill encounter trouble with this, please let me know by replying to this thread.
Awesome, thanks @Louis - will test and let you know
Yep, all purring along now @Louis - thanks!