output value of meta query arrays
-
I am working on a function to display meta data. I need to combine two arrays so I can output them withe URL and the name.
global $post; $attachmenturl = get_post_meta( $post->ID, 'wcpoa_attachment_ext_url', true); $attachmentname = get_post_meta( $post->ID, 'wcpoa_attachment_name', true); $args = array( 'posts_per_page' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'post_status' => 'publish', 'meta_query' => array( array( 'key' => 'wcpoa_attachment_ext_url', 'compare' => 'EXISTS', ), array( 'key' => 'wcpoa_attachment_name', 'compare' => 'EXISTS', ), ), ); foreach($attachmenturl as $key=>$val) { echo $val . "<br />"; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘output value of meta query arrays’ is closed to new replies.