• Resolved martinfamily2005

    (@martinfamily2005)


    ok, on this page (single.php): https://billboardfamily.com/daily-t-shirt-blog/

    you can see a section called “Flickr Photos”. The photos are actually being pulled from the post (they are all attached to the post) using the code below. Unfortunately, there are some problems.

    1) The images are all 330×265 in the actual post (I inserted them full size), but they are not displaying full size like they should.

    2) The image at the bottom, which is actually the first image in the post should not be there. I want to exclude the very firts image in the post.

    3) The images are being displayed from bottom to top in the order they are in the post….they need to be displayed in the other direction — top to bottom. (In this case, they should be in this order from top to bottom: Logo-2.png, layne-and-kate.png, The-Billboard-Family.png).

    Can you guys please help me fix these issues? Thanks!

    <?php
    
    $args = array(
        'post_type' => 'attachment',
        'numberposts' => -1,
        'post_status' => null,
        'post_parent' => $post->ID
        );
    $attachments = get_posts($args);
    if ($attachments) {
        foreach ($attachments as $attachment) {
            the_attachment_link($attachment->ID, false);
        }
    }
    
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need some help displaying images in posts’ is closed to new replies.