have_posts() is empty
-
Hi, I’m new to WP. I have problem to show looping post from a category.
Here is the codes<ul id="sliderContent"> <?php $my_query = new WP_Query('showposts=18&category_name=slides'); if ( $my_query->have_posts() ) : while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $thumb = get_post_meta($post->ID, 'thumb-large', true); ?> <li class="sliderImage"> <img src="<?php echo $thumb; ?>" alt="<?php the_title() ?>" /> </li> <?php endwhile; ?> <?php endif; ?> </ul>This codes return empty. I’ve looked on WP tutorials on the internet, this code has no problem. But why are there no images. $my_query->have_posts() returns just empty.
The owner said it was working before.
Could someone tell me what’s happened?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘have_posts() is empty’ is closed to new replies.