• I have found this code :: how do I display each image i $list array now ??

    $media_query = new WP_Query(
        array(
            'post_type' => 'attachment',
            'post_status' => 'inherit',
            'posts_per_page' => -1,
    		'post_count' => 5,
    		'numberposts' => 5,
        )
    );
    $list = array();
    foreach ($media_query->posts as $post) {
        $list[] = wp_get_attachment_url($post->ID);

    Here I am trying to fetch all images from Media Library and display them on the front page.

  • The topic ‘Image display — extracted using wp_query (noob question)’ is closed to new replies.