Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#9263 closed defect (bug) (invalid)

wp_head() hook introduces invalid markup

Reported by: pacq Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7.1
Component: Validation Keywords: wp_head(), validation
Focuses: Cc:


Starting from version 2.7.1, the wp_head() hook adds in the header the following code:

<style type="text/css">
.recentcomments a { display:inline !important;
padding: 0 !important;margin: 0 !important; }

According to the Markup Validator, the validation of the code as "XHTML strict" fails, because the "document type does not allow element style here."

Change History (3)

comment:1 @johnbillion7 years ago

Is this when using the default theme with all plugins disabled?

The placement of the wp_head() function dictates the placement of its output. In the default theme the wp_head() call is within the <head> (as it should be in all themes) and I'm fairly sure that a <style> tag is valid in the <head> tag. A plugin, however, could be adding invalid markup via the wp_head hook and causing this validation error.

comment:2 @westi7 years ago

  • Resolution set to invalid
  • Status changed from new to closed

The theme in question must have the wp_head() call in the wrong place.

That style tag is output for the recent comments widget.

The default theme validates fine with the recent comments widget enabled (even if you change it from XHTML transitional to XHTML strict)

comment:3 @Denis-de-Bernardy6 years ago

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