Can WP_Query return custom field post meta?
-
For some reason, I cannot get WP_Query to return the custom field values of posts. I can get the post thumbnails using
get_the_post_thumbnail($post->ID, array(50,50))
, but I cannot get the custom field data usingget_post_meta($post->ID, $key, true)
.A stripped-down version of what I’m trying to do can be seen here: https://pastebin.com/at8S2THs
Even with all non-essential code removed, I cannot make this work. I know you can use parameters like
meta_key
andmeta_value
in a query to narrow down the results, but I just want to display all values for the keys I specify, if they exist, for each post.Any help would be greatly appreciated…
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Can WP_Query return custom field post meta?’ is closed to new replies.