Thursday, June 21 2018
  1 Replies
  3.3K Visits
  Subscribe
How do you access image meta data using the custom taxonomy system? I am currently using

get_terms( 'wpmf-gallery-category, [ 'hide_empty', => 0 ]);

to pull in a gallery. I would like access to the image data ( title, captions, url, ect). How can I do that with your taxonomy?
more than a month ago
Hi,

Thanks for contacting us here about this extension.
How do you access image meta data using the custom taxonomy system? I am currently using

get_terms( 'wpmf-gallery-category, [ 'hide_empty', => 0 ]);

to pull in a gallery. I would like access to the image data ( title, captions, url, ect). How can I do that with your taxonomy?

You can use the code below to access to your image data:


$args = array(
'post_status' => 'any',
'post_type' => array('attachment'),
'tax_query' => array(
array(
'taxonomy' => 'wpmf-gallery-category',
'terms' => $gallery_id,
'include_children' => false
)
)
);
$query = new WP_Query($args);
$attachments= $query->get_posts();


Hope it helps!
Cheers,
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!