Awesome or awful QUERY CODE??
-
I repeat this code like five times, in order to get post from different categories(with the default query), it works perfect, but i would like to know if this is a good practice or should i create DIFFERENT QUERIES, which method is faster???
<div id="cat1" class="content"> <?php $limit=0; ?> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php if ($limit < 3) : ?> <?php if(has_category(8)) {get_template_part( 'content', 'categorypost' );$limit++; } ?> <?php endif;?> <?php endwhile; ?> <php endif;?> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Awesome or awful QUERY CODE??’ is closed to new replies.