WordPress Should Support Featured Images for Categories, Users, and More – WP Tavern

One of many options that I’ve lengthy wished for WordPress has been on my thoughts these days. It’s not a brand new thought, and it has been carried out in some type or vogue by plugin and theme authors previously. Nevertheless, it has by no means been standardized. WordPress wants featured photos for extra than simply posts. It ought to help them for taxonomy phrases (e.g., classes, tags) and customers.

One month in the past immediately, I participated in Round #13 of the FSE Outreach Program. It was the primary time that the Gutenberg plugin allowed including a brand new creator template by way of the location editor (that is coming in WordPress 6.0). Writer templates have all the time been supported if added by way of the theme, however customers now have that energy. This system known as for volunteers to check this characteristic and a few new author-related blocks.

As I all the time do when taking part within the FSE Outreach testing calls, I attempted to push the design limits of the editor. A lot of this system focuses on the person expertise, however I wish to transcend that and discover these design-related ache factors.

In the end, I settled on a design for my fake creator template:

alt="Author archive as shown on the front end of a WordPress site.  Features a large hero header with the author avatar, title, and bio."
Customized creator template.

I added a Cowl block because the backdrop for the creator profile part on the high of the web page. I favored the look of the mountains combined in with the lively theme design. The issue was that there was no option to personalize that for every person account. Certain, each person will get to pick their very own avatar and write their very own bio, however there is no such thing as a simple option to allow them to have their very own featured picture.

Technically, it’s doable to do that by creating customized author-{$id}.html or author-{$username}.html templates and manually and importing them to the theme’s /templates folder. For managed environments, akin to shopper builds with a set variety of customers/authors, it’s a chance. Even in these situations, it’s a little bit of a administration headache. And it doesn’t account for each different WordPress person who would possibly wish to do one thing comparable.

Within the traditional period, the identical concern existed. Nevertheless, it was comparatively easy to code for the entrance finish in a PHP-based templating system. For block themes, most would wish to create a customized block. The picture add type could be the identical in each situations (dealt with on person profile and taxonomy time period admin screens).

The difficulty with customized blocks is they don’t faucet into the core blocks’ built-in options. For instance, WordPress 6.0 will permit setting a Cowl block’s background utilizing the put up featured picture. In the long run, core will seemingly help this for different image-related blocks like Media & Textual content. Porting these similar options over to third-party plugins doesn’t make sense.

It additionally doesn’t empower customers who wish to construct such designs with WordPress. Nor does it present theme authors with the instruments to ship templates and patterns with distinctive layouts to the general public.

Whereas I’ve primarily centered on creator templates, the identical arguments stand for taxonomy time period templates, akin to classes and tags. For instance, I constructed out a fast class template utilizing an identical design as proven earlier:

Front end of a WordPress site for a category archive page.  The category header section has a forest image in the background with the category title and description sitting on top of it.

The picture works effectively for my instance Nature class however not a lot for others. We’d like a option to dynamically show per-category photos.

There may be not less than a stable plugin for taxonomy phrases: WP Term Images. Maybe I can persuade John James Jacoby, the plugin’s creator, to increase it to the block system.

After stewing on this for a month, I nonetheless didn’t know whether or not I might make a convincing argument for the characteristic aside from I feel this is able to be cool. I’m uncertain if there’s sufficient demand for it. Nevertheless, it’s OK to dream about new issues sometimes and share these concepts with others. So, that is me, dreaming out loud, hoping that one of many objects from my want listing will land in WordPress at some point.

What are a number of the belongings you wish to see?

Leave a Reply

Your email address will not be published.