Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter MDavid-ITA

    (@mdavid-ita)

    A small code change and the problem is solved.

    Changed:
    the_attachment_link( $attachment->ID , true );
    To
    echo wp_get_attachment_image( $attachment->ID, 'large');

    Now it works!
    ??

    Thread Starter MDavid-ITA

    (@mdavid-ita)

    I changed:

    <?php the_attachment_link(1); ?>

    to:

    <?php
    $args = array( 'post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => get_the_ID() );
    $attachments = get_posts($args);
    if ($attachments) {
    	foreach ( $attachments as $attachment ) {
    		the_attachment_link( $attachment->ID , true );
    	}
    }
    ?>

    The images is displayed properly but, unfortunately, I only can choose between original size image or thumbnail. I need to show the image the same size has been attached. :-/ I thought it was simpler.

Viewing 2 replies - 1 through 2 (of 2 total)