There was a requirement where all the posts from all the categories had to be displayed on archive page for certain category. For example if I create a category A and add some posts to it. I also create more categories B,C and D and add posts to them as well. Now if I check archive for A then it should display all the posts added including A,B,C and D and if I check posts for categories B,C and D then it should work as normal, displaying posts for their respective categories.
For this I googled around but could not find a proper solution so I derived a solution on my own, not that elegant but solved the problem. I had to show the category A only at one place so the below code was helpful.
Open wp-includes/classes.php and goto function parse_request(). Add these lines just below the line
$this->query_vars= apply_filters('request', $this->query_vars);
if($this->query_vars['category_name']=='A'){ $this->query_vars['category_name']=''; $this->query_vars['cat']='3,4,5,6'; }
Here first line matches the category name for which posts from other categories are to be shown.
Second line makes it forget about the selected category, else it dosen’t read the extra categories added to the third line.
Third line adds other categories to be picked for adding the posts.
There is also a variation for some versions where category_name does not match so you can use this:
if($this->query_vars['cat']=='3'){ // matching the id itself
Now the number denotes the category ids and the first one should be of the category for which we are getting other posts (A for this example). If there is some different category id for name ‘A’ then it should be used first. For example if category id of A is 32 then the third line should be written as below:
$this->query_vars['cat']='32,4,5,6';
Here 4,5,6 are the other categories ids.

This is a good post and I have been looking for this. However I don’t see a classes.php in wp-include.
May be it depends on the WP theme used.