here is my query <?php $my_query = new WP_Query(); $query_posts = $my_query->query($args); $my_query1 = new WP_Query($args); $pages = $my_query1->max_num_pages; if(!$pages) $pages = 1; while ( $my_query->have_posts() ) : $my_query->the_post(); $params = array('pid' => get_the_ID(), 'do' => 'delete'); $private_download = array('file_name' => $nmfilemanager -> get_attachment_file_name( get_the_ID() ), 'do' => 'download'); $urlDelete = $nmfilemanager -> fixRequestURI($params); $urlPrivateDownload = $nmfilemanager -> fixRequestURI($private_download); $meta = get_post_meta(get_the_ID(), '_wp_attachment_metadata', true); $file_meta = json_decode($meta, true); ?> PHP:
try this, But I'am not sure if it will work with your query.. <?php $args = array( 'showposts' => 16, // Change the number to the number of post you want to show ); $my_query = new WP_Query($args); $pages = $my_query1->max_num_pages; if(!$pages) $pages = 1; while ( $my_query->have_posts() ) : $my_query->the_post(); $params = array('pid' => get_the_ID(), 'do' => 'delete'); $private_download = array('file_name' => $nmfilemanager -> get_attachment_file_name( get_the_ID() ), 'do' => 'download'); $urlDelete = $nmfilemanager -> fixRequestURI($params); $urlPrivateDownload = $nmfilemanager -> fixRequestURI($private_download); $meta = get_post_meta(get_the_ID(), '_wp_attachment_metadata', true); $file_meta = json_decode($meta, true); ?> Code (markup):