osompress / genesis-portfolio-pro

Plugin: Genesis Portfolio Pro
24 stars 14 forks source link

Fix alt attribute to use image alt meta instead of portfolio item title #31

Closed nickcernis closed 6 years ago

nickcernis commented 6 years ago

This changes the alt attribute to use alt meta from the image, instead of the post title.

This prevents the title repeating, and allows custom alt text to be different than the portfolio item title.

edit_portfolio_item_ _dev_ _wordpress_and_portfolio_items

@marksabbath Please could you double check this when you get a moment? Thanks!

nickcernis commented 6 years ago

@NicktheGeek Yes, as things stand a blank alt attribute would be used if genesis_get_image() gives the fallback image (because get_post_thumbnail_id will give an empty string).

I'd like to contribute sensible default alt attributes to genesis_get_image in Genesis itself so that fetching the alt meta isn't required for child themes and plugins. For now I think having a blank alt tag on fallback images is fine. The alternatives I considered were:

It wasn't clear that either of those are better than what's there now, but I'm open to suggestions and ideas.

I think the ideal scenario is that alt tags are added in Genesis. I've opened this to discuss further: https://github.com/studiopress/genesis/issues/1934