Query posts by category not working
-
I have a query to pull all posts of a certain category. It used to work great but all of a suddenly stopped working. The only thing that has changed that I know of is the server has a newer version of php which I have no idea if that would break this. Here is what I had been using.
<?php query_posts(array('orderby' => 'DESC', 'cat' => 12,'showposts' => 12));
If I remove the ‘cat’ => 12 part I do get all posts. I assume my query is wrong but it is weird it used to work.
I also tried these.
<?php query_posts( 'category_name = sample' );
<?php query_posts( 'cat=12' ); ?>
Here is the whole code snippet.
<?php query_posts(array('orderby' => 'DESC', 'cat' => 12,'showposts' => 12)); if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="second-sb-image"> <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"> <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> <div class="second-sb-text"> <h3><?php the_title(); ?></h3> </div> </a> </div> <?php endwhile; endif; ?>
Any ideas or can someone point me in the right direction?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Query posts by category not working’ is closed to new replies.