• Resolved elaine70

    (@elaine70)


    i’m using an array of thumbnails and i keep getting lots of repeats, any suggestions?

    here’s the code i’m using


    <?php
    //for category archives
    $categoryvariable=$cat; // assign the variable as current category
    $query= ‘cat=’ . $categoryvariable. ‘&orderby=date&order=DSC’. ‘&showposts=100’; // concatenate the query
    query_posts($query); // run the query
    ?>

    <?php
    //for date archives
    query_posts($query_string . ‘&showposts=-1’); ?>

    <?php while (have_posts()) : the_post(); ?>

    <?php
    //Get images attached to the post
    $args = array(
    ‘post_type’ => ‘attachment’,
    ‘post_mime_type’ => ‘image’,
    ‘numberposts’ => -1,
    ‘order’ => ‘ASC’,
    ‘post_status’ => null,
    ‘post_parent’ => $post->ID
    );
    $attachments = get_posts($args);
    if ($attachments) {
    foreach ($attachments as $attachment) {
    $img = wp_get_attachment_thumb_url( $attachment->ID );
    break; }
    //Display image
    } ?>

    ” title=”<? the_title(); ?>”><img class=”thumbarch” src=”<?php echo $img; ?>” alt=” ” />

    <?php endwhile; ?>’

  • The topic ‘how to go past the post limit for thumbnail archive?’ is closed to new replies.