WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] edit this php snippet to show full-sz attachment? (2 posts)

  1. Cathy Tibbles
    Member
    Posted 6 years ago #

    This bit was thanks to another forum member. And it works beautifully in my theme. Now I am wondering if I can change this piece so that it will show the full-size image, instead of the thumbnail?

    <?php
    $args = array(
    'post_type' => 'attachment',
    'numberposts' => null,
    'post_status' => null,
    'post_parent' => $post->ID
    );
    $attachments = get_posts($args);
    if ($attachments) {
    foreach ($attachments as $attachment) {
    echo apply_filters('the_title', $attachment->post_title);
    the_attachment_link($attachment->ID, false);
    }
    }
    ?>
  2. Cathy Tibbles
    Member
    Posted 6 years ago #

    just change the last line from "false" to "true".

    Works. :)

Topic Closed

This topic has been closed to new replies.

About this Topic