How to query Meta from another Post
-
I’m using formidable forms plugin to create a post from the front end. Some of the meta fields are images and formidable creates a new Post to store the image and leaves this image posts ID in the meta field of the original post im creating.
What I’m trying to do now is query my original post but also the images.
function mprofile2(){ query_posts( array( 'post_type' => 'profile', 'author' => bp_displayed_user_id(), 'meta_query' => array( array( 'key' => 'multiprofile', 'value' => 'profile2', 'compare' => 'LIKE' )) )); // the Loop if (have_posts()) : the_post(); the_content( 'Read the full post ?' ); echo '<h4>',the_title(),'</h4>', '<span>Gender:</span> ', the_field('mprofile_gender'),'<br />', '<span>About:</span> ',the_field('mprofile_about'),'<br />', '<span>Hair Colour:</span> ',the_field('mprofile_haircolour'),'<br />', '<span>Hair Length:</span> ',the_field('mprofile_hairlength'),'<br />', ': ',the_field('mprofile_image1'),'<br />', ': ',the_field('mprofile_image2'),'<br />', ': ',the_field('mprofile_image3'),'<br />', ': ',the_field('mprofile_image4'); endif; }
I hope someone understands this :/
- The topic ‘How to query Meta from another Post’ is closed to new replies.