Title: Featured Posts Code &#8211; Repeated featured posts
Last modified: August 20, 2016

---

# Featured Posts Code – Repeated featured posts

 *  [itzsnider](https://wordpress.org/support/users/itzsnider/)
 * (@itzsnider)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/featured-posts-code-repeated-featured-posts/)
 * I am soooo close to getting this to work but I have two outstanding issues.
 * 1. The featured posts code keeps repeating itself before/after each post.
 * 2. It seems that the “info” class shows two hrefs for the posts I am calling 
   in CSS.
 * Any help would be greatly appreciated. The code below is what is currently in
   my loop.
 *     ```
       <?php if( is_front_page() ) : ?>
       <?php query_posts("posts_per_page=3&category_name=featured");?>
              <?php while (have_posts()) : the_post(); ?>
              <div class="featureportfolio<?php echo $i++;?>">
              <a href="<?php the_permalink() ?>" rel="bookmark" class="title">
              <?php the_post_thumbnail('thumbnail'); ?>
              <div class="info">
              <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a>
              </div>
              </div>
       <?php endwhile;?>
       <?php endif; ?>
       <div class="clear"></div>
       <?php wp_reset_query(); ?>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/featured-posts-code-repeated-featured-posts/#post-2676582)
 * > 1. The featured posts code keeps repeating itself before/after each post.
 * how is the posted snippet integrated in the full template?
 * ([please use the pastebin.com for any code over 10 lines](http://codex.wordpress.org/Forum_Welcome#Posting_Code))
 *  Thread Starter [itzsnider](https://wordpress.org/support/users/itzsnider/)
 * (@itzsnider)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/featured-posts-code-repeated-featured-posts/#post-2676583)
 * Updated with Pastebin of the entire loop.php
 * [http://pastebin.com/U1pNYieG](http://pastebin.com/U1pNYieG)
 * As soon as I remove <?php wp_reset_query(); ?> from the code it no longer repeats
   the “featured posts” but regular posts do not show any longer.
 * _[ Please don’t bump, that’s [not permitted](http://codex.wordpress.org/Forum_Welcome#No_Bumping)
   here. ]_

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Featured Posts Code – Repeated featured posts’ is closed to new replies.

## Tags

 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [itzsnider](https://wordpress.org/support/users/itzsnider/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/featured-posts-code-repeated-featured-posts/#post-2676583)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
