Title: Query Within Loop
Last modified: August 19, 2016

---

# Query Within Loop

 *  [Doobus](https://wordpress.org/support/users/doobus/)
 * (@doobus)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/query-within-loop/)
 * I want to put a query within the loop in the single.php section. What I’m trying
   to do is call a query to display related posts by category. I was also wondering
   if it is possible to have the query automatically detect the category the post
   is in, so it pulls the correct posts.
 * Thanks for help.

The topic ‘Query Within Loop’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Doobus](https://wordpress.org/support/users/doobus/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/query-within-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
