Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#50433 closed enhancement (fixed)

Twenty Twenty: Hide extraneous elements in print.css

Reported by: kjellr's profile kjellr Owned by: desrosj's profile desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch has-screenshots commit
Focuses: Cc:


Twenty Twenty hides many elements in the print view (e.g. the comments form, site navigation, site logo, etc.). There are still a few remaining elements that make sense to be removed too:

  • Category. This feels like an odd lead-in to the page in a printed context. In most cases, this is primarily useful for viewing more posts in that category.
  • Comment Count. The theme hides the comments in the print view, so I'm not sure that it makes sense to keep the comment count here.
  • Previous/Next posts pagination.

(In the following screenshots, the Jetpack likes + shares should be hidden too, but that may be something that the Jetpack plugin should handle itself.)

Attachments (3)

50433.diff (606 bytes) - added by Hareesh Pillai 4 years ago.
Patch removes the elements in print mode
Before.png (274.4 KB) - added by Hareesh Pillai 4 years ago.
After.png (138.3 KB) - added by Hareesh Pillai 4 years ago.
After applying the patch

Download all attachments as: .zip

Change History (11)

@Hareesh Pillai
4 years ago

Patch removes the elements in print mode

@Hareesh Pillai
4 years ago


@Hareesh Pillai
4 years ago

After applying the patch

#1 @Hareesh Pillai
4 years ago

  • Keywords has-patch has-screenshots added

#2 @kjellr
4 years ago

Thanks, @hareesh-pillai, this patch works in my testing. ✅

#3 @Hareesh Pillai
3 years ago

  • Milestone changed from Awaiting Review to 5.8

#4 @poena
3 years ago

  • Keywords commit added

#5 @desrosj
3 years ago

  • Owner set to desrosj
  • Status changed from new to reviewing

#6 @desrosj
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 50976:

Twenty Twenty: Hide some elements for print that are not useful in that context.

This adds the comment count, previous/next posts navigation, and category link list to the list of elements hidden from the print context.

Props kjellr, hareesh-pillai, poena.
Fixes #50433.

#7 @sabernhardt
3 years ago

In addition to the three elements mentioned in the ticket description, changeset [50976] also hides the post/page Edit link (which is a good idea).

#8 @desrosj
3 years ago

@sabernhardt Ah yes, thanks for calling that out here. I meant to add that to my commit message, and it slipped my mind.

Note: See TracTickets for help on using tickets.