Black Friday & Cyber Monday Offer | Flat 20% OFF on Lifetime & All Themes Package. Use coupon code BFCM24 | Offer valid till 5th Dec 2024 Buy Now

WordPress Website Templates

Find Professional WordPress themes Easy and Simple to Setup

inner banner

Social Care Pro, Feature request to add Alt text to Home Page images

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24152
    Phil Huhn
    Participant

    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,
    Phil

    #24177
    Phil Huhn
    Participant

    Hey 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,
    Phil

    #24186
    Grace Support
    Keymaster

    Hi Phil,

    Thanks for your suggestion. We will make this changes in our next theme updates.

    Regards
    Grace Themes

    #24192
    Phil Huhn
    Participant

    Hey:

    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,
    Phil

    #24212
    Grace Support
    Keymaster

    Thank you again.!

    We will inform you once we update our theme.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.