Should I replace query_posts on my index page?
-
I have been reading that no one should use query_posts anymore? My site works fine, loads quickly, displays as I want, but I should change it?
Can anyone out there have a look at the code I’m using and let me know if I should just leave it, or if I need to change it, and if I do, change it to what? Thanks.
I have 4 sections on my home page, each shows posts from a different category. One section shows 10 news stories, another 1 story with a video, etc.
I just use this same code 4 times, changing the obvious parameters:<?php query_posts('category_name=video&showposts=1;'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3> <?php the_content(); ?> <?php echo do_shortcode( '[hupso]' ); ?> <div class="rightdate"><?php the_time('F jS, Y') ?></div> <div class="commentlink"><?php comments_popup_link('Comment »', '1 Comment »', '% Comments »'); ?></div> <?php the_tags('<p class="post-tags"><strong>Tags:</strong> ', ', ', '</p>'); ?> <div class="clear"></div> <?php if ( $user_ID ) : ?> <?php edit_post_link(); ?> <?php endif; ?> <div class="clear"></div> </div> <?php endwhile; ?> <?php endif; ?>
Site is at https://rebellionnews.com/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Should I replace query_posts on my index page?’ is closed to new replies.