I'm presently using WordPress to construct my portfolio website. The website includes:

  • a home page showing "project" posts (using publish groups).
  • an about us page
  • a projects page (much like home page) showing pictures and game titles of latest projects.
  • a task detail page (this can be a click through from either the home page or projects page and shows detail on the particular project.

Around the project detail page I've a picture slider which I wish to show the job connected with this project. I have tried personally the next function call to come back all images connected using the publish: <?php display_images_in_list('medium'); ?>which calls the next function:

function display_images_in_list($size = thumbnail) {

if($images = get_posts(array(
    'post_parent'    => get_the_ID(),
    'post_type'      => 'attachment',
    'numberposts'    => -1, // show all
    'post_status'    => null,
    'post_mime_type' => 'image',
            'orderby'        => 'menu_order',
            'order'           => 'ASC',
))) {
    foreach($images as $image) {
        $attimg   = wp_get_attachment_image($image->ID,'medium');
        echo "<div class='slide'>".$attimg."</div>";
    }
}

Despite the fact that I've specified I'd like medium images came back my slider still features the thumbnail image that we submitted to exhibit on another page.

How do i show only medium images?

whenever you upload image as attachment to publish wordpress produces pictures. You can't upload a thumbnail. Should you upload large image, and thumb image both is going to be proven. You have to upload only large images and of computer can have medium size as you want.