Title: $query_string plus category issues
Last modified: August 19, 2016

---

# $query_string plus category issues

 *  [tdevine33](https://wordpress.org/support/users/tdevine33/)
 * (@tdevine33)
 * [15 years ago](https://wordpress.org/support/topic/query_string-plus-category-issues/)
 * I have my loop running so that if you’re on the tag page (ie: [http://www.website.com/tag/baseball](http://www.website.com/tag/baseball))
   it will get all the posts using the global query string that also have a Category
   ID of 27, but it is returning things that aren’t in the global query string.
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * What is wrong with my code? ANY help is greatly appreciated!

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

 *  Thread Starter [tdevine33](https://wordpress.org/support/users/tdevine33/)
 * (@tdevine33)
 * [15 years ago](https://wordpress.org/support/topic/query_string-plus-category-issues/#post-2071932)
 * [http://pastebin.com/BJEJUyet](http://pastebin.com/BJEJUyet)
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [15 years ago](https://wordpress.org/support/topic/query_string-plus-category-issues/#post-2072000)
 * I’m not completely sure, but I think the issue is that you have the loop inside
   of the if(is_tag()) check. Instead of doing that, try putting all of your code,
   except the if(is_tag()) inside of a file called tag.php

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

The topic ‘$query_string plus category issues’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/query_string-plus-category-issues/#post-2072000)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
