Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#21423 closed defect (bug) (invalid)

wp_list_pages() is not aware of the current page inside the loop so the correct css classes are not set

Reported by: thedaysse's profile thedaysse Owned by:
Milestone: Priority: normal
Severity: trivial Version: 3.4.1
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

Because is_page() doesn't work inside the loop any widget that calls wp_list_pages() also fails to put the right css on the generated list. The fix is for wp_list_pages() to have an extra option so we can tell it explicitly what $ID we are on when we call it:

'current_page' => 0, would do it

Fixing is_page() and is_singular() so that they give the expected results inside the loop would also solve the issue

Change History (3)

#1 @nacin
12 years ago

  • Keywords reporter-feedback added

Can you provide some code to reproduce your problem? I'm not sure I understand "Because is_page() doesn't work inside the loop any widget that calls wp_list_pages() also fails". is_page() works just fine anywhere in a theme, based on whatever the main loop is.

#2 @thedaysse
12 years ago

  • Resolution set to invalid
  • Severity changed from minor to trivial
  • Status changed from new to closed

Hi
This is a false alarm and safe to close - caused by the plugin "Map Categories to Pages". I haven't yet figured out just what the plugin does that breaks all the is_ functions.

#3 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.