Make WordPress Core

Opened 6 months ago

Last modified 4 months ago

#65306 new defect (bug)

Twenty Thirteen: ".sidebar .entry-meta" selector is too broad, compresses block-rendered entry-meta

Reported by: gustavohappyeng Owned by:
Priority: normal Milestone: Awaiting Review
Component: Bundled Theme Version: 3.6
Severity: normal Keywords: has-patch
Cc: Focuses: ui, css

Description

In wp-content/themes/twentythirteen/style.css (and rtl.css), the rule:

.sidebar .entry-header,
.sidebar .entry-content,
.sidebar .entry-summary,
.sidebar .entry-meta {
    max-width: 1040px;
    padding: 0 376px 0 60px;
}

applies a 376px right padding to any descendant .entry-meta (or .entry-content / .entry-summary / .entry-header) when the Secondary Widget Area is active. When a block outputs .entry-meta markup (for example a third-party block plugin that emits the same class), it inherits the padding and is squeezed into ~168px of usable width, even though it has no relation to the theme's classic-template .entry-meta.

Steps to reproduce

  1. Activate Twenty Thirteen on a self-hosted install.
  2. Add a widget to the Secondary Widget Area (this activates the .sidebar class).
  3. Create a page or post containing a block that renders <div class="entry-meta">…</div>. A Custom HTML block with the following content reproduces it without any extra plugin:
    <div class="entry-meta">By <a href="#">Author</a> • <time>May 21, 2026</time></div>
    
  4. View the page. The author/date line is squeezed into ~168px on the left side of the content column.

Reproduced on a vanilla self-hosted WordPress install with Twenty Thirteen 4.6.

Expected behavior

The .sidebar .entry-meta rule should only style the theme's own classic-template .entry-meta (the one that is a direct child of .hentry). Block-rendered .entry-meta nested elsewhere in the document should not inherit the 376px / 60px padding.

Proposed fix

Scope each selector to a direct child of .hentry:

.sidebar .hentry > .entry-header,
.sidebar .hentry > .entry-content,
.sidebar .hentry > .entry-summary,
.sidebar .hentry > .entry-meta {
    max-width: 1040px;
    padding: 0 376px 0 60px;
}

Same change mirrored in rtl.css. The theme's own classic templates emit .entry-meta as a direct child of .hentry, so the existing layout is preserved. Block-emitted .entry-meta nested inside other wrappers no longer matches.

A GitHub PR with the patch is open against WordPress/wordpress-develop: ​https://github.com/WordPress/wordpress-develop/pull/11929 — I will add a comment with the patch link once this ticket is filed.

Change History (4)

This ticket was mentioned in ​PR #11929 on ​WordPress/wordpress-develop by ​@gustavohappyeng.


6 months ago
#1

  • Keywords has-patch added

## Description

In wp-content/themes/twentythirteen/style.css (and rtl.css), the rule:

.sidebar .entry-header,
.sidebar .entry-content,
.sidebar .entry-summary,
.sidebar .entry-meta {
    max-width: 1040px;
    padding: 0 376px 0 60px;
}

applies a 376px right padding to any descendant .entry-meta (or .entry-content / .entry-summary / .entry-header) when the Secondary Widget Area is active. Block-rendered .entry-meta markup (e.g. emitted by a block plugin that uses the same class) inherits the padding and is squeezed into ~168px of usable width.

This PR scopes each selector to a direct child of .hentry, so only the theme's own classic-template .entry-meta is affected. Block-emitted .entry-meta nested elsewhere no longer matches.

## Steps to reproduce

  1. Activate Twenty Thirteen on a self-hosted install.
  2. Add a widget to the Secondary Widget Area.
  3. Create a page with a Custom HTML block containing:
    <div class="entry-meta">By <a href="#">Author</a> • <time>May 21, 2026</time></div>
    
  4. Before this patch: author/date is squeezed into ~168px on the left. After: full width.

## Verification

  • Custom HTML block page with .entry-meta: no longer compressed.
  • Single post: theme's own footer .entry-meta + .entry-content still 376px right padding / 1040px max-width.
  • Category archive: each entry preserves sidebar layout.
  • RTL (rtl.css): mirrored fix; theme own meta retains the inverted padding.

## Files

  • src/wp-content/themes/twentythirteen/style.css
  • src/wp-content/themes/twentythirteen/rtl.css

#2 @sabernhardt
6 months ago

  • Version trunk → 3.6

​@sabernhardt commented on ​PR #11929:


4 months ago
#3

The .hentry class is a problem because the post class list is filtered. For example, ​WooCommerce removes the hentry post class from product posts, and ​SiteSEO has an advanced option to ​remove it from any post. Any other class name might have the same problem too.

Twenty Thirteen's stylesheet already removes the extra padding in .entry-header with a separate ruleset, and I think it should have something similar for widgets (at the end of the '6.1 Widgets' section).

​https://github.com/WordPress/wordpress-develop/blob/7920dd05d86715cae434a1302f68a41199abfc54/src/wp-content/themes/twentythirteen/style.css#L1042-L1044

If the new ruleset would list all 4 entry- classes together at a specificity of 0-2-0, it would need to be added again in rtl.css.

.sidebar .widget :where(.entry-header, .entry-content, .entry-summary, .entry-meta) {
	padding: 0;
}

​@sabernhardt commented on ​PR #11929:


4 months ago
#4

For testing, I ​searched for a plugin that assigns the entry-meta class within a block. (If this had only occurred in Custom HTML, it probably would not be worth editing a stylesheet used by thousands of sites.)

  • ​Gutentor has a "Post Widget" that includes an entry-meta class.
  • ​Kadence Blocks' "Posts" block can include entry-header, entry-summary, and entry-meta.
Note: See TracTickets for help on using tickets.