Opened 19 years ago
Closed 16 years ago
#2959 closed defect (bug) (fixed)
wp_list_pages does not add current_page_item class on page_for_posts
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Template | Keywords: | has-patch |
Focuses: | Cc: |
Description
Menus that rely on wp_list_pages are broken when page_for_posts is accessed.
Attachments (2)
Change History (21)
#1
@
19 years ago
- Keywords has-patch 2nd-opinion added
- Owner changed from anonymous to skeltoac
- Status changed from new to assigned
#3
@
18 years ago
- Milestone changed from 2.1 to 2.1.2
- Resolution fixed deleted
- Status changed from closed to reopened
current_page_item is again _not set_ on page_for_posts in 2.1.1
(it worked in 2.1)
#4
@
18 years ago
See also #3910 - a duplicate of this bug.
So I finally understand how to reproduce the bug (and agree it is a bug):
a) Make a few pages in WordPress
b) On the Options / Reading page, choose one of your pages to be the "posts page", and update.
c) Make sure wp_list_pages is in the blog sidebar for your theme.
d) Visit the blog page. Click on the page that you chose as the "posts page", and you will see posts, but the CSS class for the LI in the posts list on the right is not set to be "current_page_item". Click on a different page, and when that page is displayed, the LI class is set to "current_page_item".
Is that right? I'll test the patch above.
#7
in reply to:
↑ 5
@
18 years ago
Replying to jhodgdon:
Apparently, [4956] took the changes from [4023] back out, to fix #3885 ... thereby reopening this bug instead.
jhodgdon: You have described how to duplicate the problem exactly. That is the issue. It worked correctly in 2.1, but not in 2.1.1 --- thanks for taking steps to resolve it.
#12
@
17 years ago
- Owner changed from ryan to ariejan
- Status changed from new to assigned
Ping
Does anyone know why this bug hasn't been fixed yet? Are there any problems in particular that prevent this bug from being fixed?
#14
@
17 years ago
Hi there. Just wanted to add more info about this bug. Many users have reported and discussed it in the WP forums at: http://wordpress.org/support/topic/107583. I have outlined the troubleshooting steps required to replicate & resolve the problem on my blog at: http://www.umaitech.com/cms/?p=27.
#16
@
17 years ago
- Keywords has-patch added; needs-patch removed
- Status changed from new to assigned
#18
@
16 years ago
- Cc redbrandonk removed
- Milestone changed from 2.5 to 2.8
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 2.1 to 2.7
This fix only gives the current_page_item class to the blog page when you are on the blog page. The blog page is no longer given current_page_item once you click on one of the posts. This is something that I have seen many users complaining about.
Perhaps we should give the blog page current_page_parent and maybe even current_page_ancestor when on a single post?
Attached patch introducing $wp_query->is_posts_page and modifying $wp_query->get_queried_object().