developer-blog-content icon indicating copy to clipboard operation
developer-blog-content copied to clipboard

Tutorial on aspect ratios in WordPress 6.6

Open bph opened this issue 1 year ago • 4 comments

Discussed in https://github.com/WordPress/developer-blog-content/discussions/281

Originally posted by justintadlock July 2, 2024 This is a new feature landing in WordPress 6.6 for theme authors: https://make.wordpress.org/core/2024/06/24/miscellaneous-editor-changes-in-wordpress-6-6/#Add-custom-Aspect-Ratio-presets-through-theme-json

I propose a simple walkthrough tutorial of how to implement custom aspect ratios via theme.json or theme style variations. The tutorial could even include they can be used in patterns/templates. This feature allows users to use these aspect ratios with blocks that support them, such as Image, Featured Image, and Cover. _Note that wide/full Image blocks do not currently support setting an aspect ratio.

Example of custom ratios as shown in the editor:

image

This should be pretty low-hanging fruit in terms of a tutorial.

bph avatar Jul 04 '24 16:07 bph

Working on this one here: https://docs.google.com/document/d/1NOB7mGBoPMft7e1MHJA27-uvDAqNNoJiB5K5XZO6HUM/edit?usp=sharing

justintadlock avatar Jul 23 '24 13:07 justintadlock

This one is ready for a first review.

justintadlock avatar Jul 23 '24 21:07 justintadlock

I can do that tomorrow!... from my phoneOn Jul 23, 2024, at 4:43 PM, Justin Tadlock @.***> wrote: This one is ready for a first review.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

marybaum avatar Jul 23 '24 23:07 marybaum

Done! Hope you like it as much as I did going through!

marybaum avatar Jul 25 '24 20:07 marybaum

Thanks, @marybaum! It was nice to get your feedback again.

justintadlock avatar Aug 05 '24 16:08 justintadlock

Did a quick review @justintadlock and just left a single comment.

ryanwelcher avatar Aug 05 '24 17:08 ryanwelcher

Social Copy:

WordPress 6.6 introduced support for custom aspect ratios. Learn how to register your own via theme.json:

https://developer.wordpress.org/news/2024/08/05/registering-custom-aspect-ratios-in-wordpress-6-6/

justintadlock avatar Aug 05 '24 19:08 justintadlock

You are most welcome! It was fun to do.When I’m better I hope to be around more. On Aug 5, 2024, at 11:46 AM, Justin Tadlock @.***> wrote: Thanks, @marybaum! It was nice to get your feedback again.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

marybaum avatar Aug 06 '24 00:08 marybaum