Ticket #2959 (closed defect: fixed)

Opened 2 years ago

Last modified 6 months ago

wp_list_pages does not add current_page_item class on page_for_posts

Reported by: skeltoac Assigned to: mdawaffe
Priority: normal Milestone: 2.5
Component: Template Version: 2.1
Severity: normal Keywords: has-patch
Cc: redbrandonk

Description

Menus that rely on wp_list_pages are broken when page_for_posts is accessed.

Attachments

posts-page.diff (1.6 kB) - added by skeltoac on 07/19/06 10:47:20.
2959.diff (508 bytes) - added by mdawaffe on 02/27/08 22:36:04.

Change History

07/19/06 10:47:20 changed by skeltoac

  • attachment posts-page.diff added.

07/19/06 10:48:52 changed by skeltoac

  • keywords set to has-patch 2nd-opinion.
  • owner changed from anonymous to skeltoac.
  • status changed from new to assigned.

Attached patch introducing $wp_query->is_posts_page and modifying $wp_query->get_queried_object().

07/20/06 02:05:27 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [4023]) Fix current page handling when using page_for_posts. Props skeltoac. fixes #2959

02/27/07 13:49:51 changed by francesconegri

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from 2.1 to 2.1.2.

current_page_item is again _not set_ on page_for_posts in 2.1.1 (it worked in 2.1)

03/07/07 15:01:53 changed by jhodgdon

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.

(follow-up: ↓ 7 ) 03/07/07 15:08:20 changed by jhodgdon

Apparently, [4956] took the changes from [4023] back out, to fix #3885 ... thereby reopening this bug instead.

03/08/07 01:32:51 changed by ryan

  • owner changed from skeltoac to ryan.
  • status changed from reopened to new.

(in reply to: ↑ 5 ) 03/08/07 02:33:44 changed by dwzemens

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.

04/03/07 18:34:40 changed by redbrandonk

  • cc set to redbrandonk.

04/12/07 18:36:39 changed by foolswisdom

  • milestone changed from 2.1.4 to 2.2.

05/01/07 13:49:38 changed by Nazgul

  • keywords changed from has-patch 2nd-opinion to needs-patch.

05/12/07 22:08:53 changed by ryan

  • milestone changed from 2.2 to 2.3.

11/04/07 22:33:03 changed by ariejan

  • 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?

11/05/07 05:01:22 changed by lloydbudd

ariejan, "needs-patch"

02/12/08 19:53:10 changed by betsyk

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.

02/27/08 21:48:14 changed by mdawaffe

  • owner changed from ariejan to mdawaffe.
  • status changed from assigned to new.

02/27/08 22:35:31 changed by mdawaffe

  • keywords changed from needs-patch to has-patch.
  • status changed from new to assigned.

[4956] and [4023] are unrelated. The regression was caused by [4863] [4864] fixing #3049.

Attached gives the current_page_item class to the page_for_posts page and does not cause a #3049 regression.

02/27/08 22:36:04 changed by mdawaffe

  • attachment 2959.diff added.

02/27/08 22:38:03 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7073]) Add current_page_item on page_for_posts. Props mdawaffe. fixes #2959