Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Posts: Add missing class to post title #38740

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Feb 11, 2022

Description

The Latest Posts block outputs CSS classes for every element except the post title, which makes it hard to style the post title with custom CSS. This PR simply adds the wp-block-latest-posts__post-title class.

Testing Instructions

  1. Use Twenty Twenty-Two or similar theme.
  2. Add the Latest Posts block to a page.
  3. Check the frontend and Editor view look the same and that the wp-block-latest-posts__post-title class is added to the post titles.

Types of changes

Bug fix / Enhancement

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@ndiego ndiego added [Type] Bug An existing feature does not function as intended [Block] Latest Posts Affects the Latest Posts Block labels Feb 11, 2022
@ndiego ndiego requested review from ryelle and ellatrix February 11, 2022 11:16
@ndiego ndiego self-assigned this Feb 11, 2022
@ndiego ndiego requested a review from ajitbohra as a code owner February 11, 2022 11:16
@ndiego ndiego merged commit f289d91 into WordPress:trunk Feb 15, 2022
@ndiego ndiego deleted the fix/missing-class-in-latest-posts branch February 15, 2022 10:57
@github-actions github-actions bot added this to the Gutenberg 12.7 milestone Feb 15, 2022
@adrianahdez
Copy link

adrianahdez commented Apr 12, 2024

Hi,
I think this is not correct.
Why the post title class is added (only in Editor) to the featured image element and not to the post title element?
I've set styles for the post title to apply to both (frontend and Editor) and in the Editor these styles are applying to the featured image.

In the Editor, the class for the Post title (.wp-block-latest-posts__post-title) is on the feature image HTML element, and the post title element doesn't have the class.
image

That's why the styles I've defined for that block look wrong in the Editor.

@ndiego @carolinan I don't know if I should open another issue for this. Let me know

@carolinan
Copy link
Contributor

@adrianahdez HI
Yes, if there isn't already an issue, please open a new issue, because it is not as discoverable here. Fewer people will find it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants