Social Care Pro, Feature request to add Alt text to Home Page images
Tagged: Alt text, feature request, Images, Social Care Pro
- This topic has 4 replies, 2 voices, and was last updated 3 years, 10 months ago by Grace Support.
-
AuthorPosts
-
June 13, 2020 at 2:18 pm #24152Phil HuhnParticipant
Hey:
I have a feature request for Social Care Pro to add Alt text option to Home Page images. This will make this Theme more ADA compliant. Some federal and state grant require the website to be ADA compliant. A larger feature and selling component would be to make the whole theme ADA compliant.
I used a free compliant called SiteImprove Accessibility Checker to check the home page.
Thanks,
PhilJune 14, 2020 at 6:14 pm #24177Phil HuhnParticipantHey Again:
For example you have 4 shortcode in inc/custom-functions.php that are something like the following:
extract(shortcode_atts(array( 'image' => '', 'title' => '', ... ), $atts)); return ' ... '<img src="'.$image.'" alt="" />'
If the above is changed to the following, then you would have a more ADA compliant theme with alt text:
extract(shortcode_atts(array( 'image' => '', 'alt' => '', 'title' => '', ... ), $atts)); if( $alt =='' ) { $alt = $title; } return ' ... '<img src="'.$image.'" alt="'.$alt.'" />'
Additionally, with parent themes, it’s good practice to make your functions pluggable so that you can easily override them in child themes. This simply means to wrap them in a conditional tag with PHP’s function_exists() to check if a function with that name has already been run.
Thanks,
PhilJune 15, 2020 at 5:49 am #24186Grace SupportKeymasterHi Phil,
Thanks for your suggestion. We will make this changes in our next theme updates.
Regards
Grace ThemesJune 15, 2020 at 1:03 pm #24192Phil HuhnParticipantHey:
When are you expecting the next theme update?
I have two more updates to header.php. I believe I found a shortcoming in header.php, per the homepage slider. On line 160, the images are displayed as follows:
$n++; ?><img src="<?php echo esc_url($sv['image_src']); ?>" alt="<?php echo esc_attr($sv['image_title']);?>" title="<?php echo '#slidecaption'.$n ; ?>"/><?php
Notice that the alt text is assigned a value, but that value is never created. I created it, around line 149, as follows:
$slAr[$m]['image_url'] = of_get_option('slidelink'.$i, true); $slAr[$m]['image_title'] = of_get_option('slidetitle'.$i, true); $m++;
Additionally in header.php to add alt text for the logo, I changed line 64 as follows:
<a href="<?php echo home_url('/'); ?>"><img src="<?php echo esc_url( of_get_option( 'logo', true )); ?>" alt="<?php bloginfo('name'); ?> Logo" /></a>
Finally don’t forget to informed me when you expecting the next theme update?
Thanks,
PhilJune 16, 2020 at 5:17 am #24212Grace SupportKeymasterThank you again.!
We will inform you once we update our theme.
-
AuthorPosts
- You must be logged in to reply to this topic.