Opened 12 years ago
Closed 8 years ago
#18386 closed defect (bug) (worksforme)
Bug in custom query when "Front page displays": "A static page"
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.2.1 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
Here is the bug I have found:
When Front page displays is set to: A static page
and Blog posts are displayed on other page a bug accours...
Lets prepare test enviroment, with clear wp installation and two posts, where one of them is set to default category, and other is set to newly created category (which defautly has ID = 3).
Now, prepare two pages, and in Setting -> Reading set Front page to one of those pages, and Posts page to second one.
If You would like to exclude posts from category no 3 from main blog index, normaly You would use:
<?php query_posts($query_string . '&cat=-3'); ?> in index.php (or specified loop file linked there).
This would work if blog index is set as home page, but fails to work when above test enviroment is used.
Attachments (1)
Change History (12)
#2
@
12 years ago
Thanks for reply and patch. Could You explain, what tools can be used to easily apply this patch to local version(Ps/Mac) beside normal file editing?
After patching will try do do some testing.
#3
@
12 years ago
Ok, I have managed to apply patch in Aptana.
dd32 -> Your's patch seems to work ok on test environment acting as one of my blogs. Now I'll try to appply it to working blog, and will check, if everything seems ok.
#6
@
11 years ago
- Version changed from 3.2.1 to 3.3.2
Sadly the bug is still here.
Could anybody take look at it again, and prepare working patch, and also submit it to someone, who will know what to do with it, so it can be added reviewed and added to next milestone?
#7
@
11 years ago
Ups, the patch is still working ok, so the only question is, how to submit this solution to be approved and added to next WP version?
#8
@
11 years ago
- Keywords needs-unit-tests added
- Milestone changed from Awaiting Review to Future Release
- Version changed from 3.3.2 to 3.2.1
Version number indicates when the bug was initially introduced/reported.
#9
@
11 years ago
- Keywords needs-patch added; has-patch removed
moving back to needs-patch since this patch will definately have unintended side effects, there would have to be a better way than this.
Confirmed. Taxonomy Queries are not processed when page_for_posts is set; As a result, the category exclusion code is never run causing query_posts to
not be effectivenot work as expected..Attached patch deals with the taxonomy side of things, however Author specification and a few other things might also be affected (those in the else branch here: Line 1467 of query.php)
(note: I havn't tested any side effects of the patch, I'm hoping someone who feels like digging into WP_Query will take it and run :))