WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Loop displaying featured image problem (2 posts)

  1. herowp
    Member
    Posted 4 months ago #

    Howdy all.

    I have this loop

    <?php
    
                                        global $post;
    
                                        global $data;
    
                                        $args=array('post_type'=> 'logo','post_status'=> 'publish', 'orderby'=> 'menu_order', 'posts_per_page'=>6); 
    
                                        $logo_posts = query_posts($args);  
    
                                        //print_r($postsss);
    
                                        $i =1;	
    
                                        while ( have_posts()):the_post();
    
                                            $class = "";
    
                                            if($i == 6): $class="last"; else : $class=""; endif;
    
                                ?>
    
                                <?php
    							  $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    							?>
    
                                <div class="logo span6 <?php echo $class;?>"><!--Logo start-->
    
                                    <img src="<?php echo aq_resize($feat_image, 157, 95, true ) ; ?>" alt="<?php the_title(); ?>" />
    
                                </div><!--Logo end-->
    
                                <?php endwhile;?>	<!--End the loop-->		
    
                                <?php  wp_reset_query(); wp_reset_postdata();?><!--reset post data-->

    My problem is the loop is displaying only the first image, the third image and so on. The second and the fourth image are not displayed. Here is a preview for a better understanding http://tinypic.com/view.php?pic=o2weq&s=5

  2. herowp
    Member
    Posted 4 months ago #

    I figured it out. It was from the aq_resize function. The images that I have uploaded were smaller then 157x95. :)

Reply

You must log in to post.

About this Topic