kamrankhan
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: wp_query and featured image problemDamn, that makes sense.
However, why does the previous code not work? Shouldn’t the query go through all the posts and organize and then display only the ones with featured images?
Forum: Fixing WordPress
In reply to: wp_query and featured image problemthis worked:
$postslist = get_posts( array( 'numberposts' => 10, 'order'=> 'DESC', 'orderby' => 'title', 'post_type' => 'any' ) ); foreach ($postslist as $post) : setup_postdata($post); ?> <?php if ( has_post_thumbnail()) : ?> <li><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php the_post_thumbnail( array( 1000, 315), array( 'class' => 'slideshow-img' ) ) ?> </a></li> <?php endif; ?> <?php endforeach; ?>
but it only displayed the first three posts. Changing numberposts to 1000 displays all of them (there are only 10 posts with featured images assigned’. What the fudge is wrong with my code?
Forum: Fixing WordPress
In reply to: wp_query and featured image problemSo this works:
<?php $my_query = new WP_Query( array ( 'order' => 'DESC' ) ); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php setup_postdata($post); ?> <?php if ( has_post_thumbnail()) : ?> <li><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php the_post_thumbnail( array( 1000, 315), array( 'class' => 'slideshow-img' ) ) ?></a></li> <?php endif; ?> <?php endwhile; ?>
Except, it won’t show any pages with featured images. UGGHHH.. This should be dementedly easy; what am I doing wrong?
Forum: Fixing WordPress
In reply to: Update to 3.2 .1 problemYou access phpmyadmin through your hosting/server account, not through wordpress.
Forum: Fixing WordPress
In reply to: wp_query and featured image problemcorrection
Sorry about this but I just realsied that the code works, but it only shows the first featured post. It doesn’t move forward with other posts that have featured images associated with it.