Title: Custom loop inside single.php problem
Last modified: August 19, 2016

---

# Custom loop inside single.php problem

 *  [Marcomail](https://wordpress.org/support/users/marcomail/)
 * (@marcomail)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/custom-loop-inside-singlephp-problem/)
 * I have add this custom loop before comment template in single.php page
 *     ```
       <?php $my_query = new WP_Query('category_name=example' );
         while ($my_query->have_posts()) : $my_query->the_post();
         $do_not_duplicate = $post->ID; ?>
           <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
         <?php endwhile; ?>
       ```
   
 * but now the comment loop doesn’t work 🙁
    . .
 * [**moderated–bump removed.** Please refrain from bumping as per [Forum Rules](http://wordpress.org/support/topic/68664?replies=6)]

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/custom-loop-inside-singlephp-problem/#post-974932)
 * [@marcomail](https://wordpress.org/support/users/marcomail/) – please don’t bump
   threads

Viewing 1 replies (of 1 total)

The topic ‘Custom loop inside single.php problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/custom-loop-inside-singlephp-problem/#post-974932)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
