wp_query not displaying post_type attachment, audio, or video files
-
How do I pass and display $query variable should display attachment, audio, or video file types from WP media library? So far, I have the code below trying to display attachments to a dedicated page template, however code below only passes “array array array array array…”
<?php $args = array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'posts_per_page' =>25, // 'post_parent' => 210, // Post-> ID; // 'numberposts' => null, ); // The Query $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); // do stuff echo $posts; endwhile; endif; // Reset Post Data wp_reset_postdata(); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘wp_query not displaying post_type attachment, audio, or video files’ is closed to new replies.