Osclass Support Forums

Osclass theme support => Veronika Osclass Responsive Theme => Topic started by: danads on October 05, 2022, 10:36:34 PM

Title: Alt attribute for images is missing
Post by: danads on October 05, 2022, 10:36:34 PM
I have this line on header.php

Quote
<a class="picture tr1" href="<?php echo osc_user_profile_url(); ?>"><img src="<?php echo osc_current_web_theme_url('images/profile-default.png'); ?>"/></a>

I need alt= to be ad on this line please. how it is, thanks
Title: Re: Alt attribute for images is missing
Post by: MB Themes on October 07, 2022, 09:29:33 AM
@danads
Code: [Select]
<a class="picture tr1" href="<?php echo osc_user_profile_url(); ?>"><img src="<?php echo osc_current_web_theme_url('images/profile-default.png'); ?>" alt="I am alt"/></a>
Title: Re: Alt attribute for images is missing
Post by: Own Petz on November 19, 2022, 06:16:18 AM
how to solve this - when i am scanning seo analyzer then getting this error (error attached)

We found 42 images on this web page -  9 ALT attributes are empty or missing.


thanks in Advance.
Title: Re: Alt attribute for images is missing
Post by: MB Themes on November 19, 2022, 10:14:18 AM
You will add alt attributes to them
Title: Re: Alt attribute for images is missing
Post by: Own Petz on November 20, 2022, 08:50:10 AM
thanks for reply.

But can you please tell me where i have to do this .. its all that images which I have uploaded for categories in small cat folder. I have tried to do in functions.php but nothing happened . please see attached image. 

I have checked in page source these images showing in 2 places in one place Alt attribute missing and in other place Alt Attribute showing. please check in the image and suggest me how to fix ...

Thanks in Advance.
Title: Re: Alt attribute for images is missing
Post by: Own Petz on November 21, 2022, 01:45:34 PM
Waiting for reply..
Title: Re: Alt attribute for images is missing
Post by: Own Petz on November 22, 2022, 12:21:54 PM
still waiting , can anyone please suggest me
Title: Re: Alt attribute for images is missing
Post by: MB Themes on November 22, 2022, 12:45:29 PM
Line 87 in inc.category.php
Find:
Code: [Select]
                          <img src="<?php echo osc_current_web_theme_url();?>images/small_cat/<?php echo osc_category_id();?>.png"/>

Replace with:
Code: [Select]
                          <img src="<?php echo osc_current_web_theme_url();?>images/small_cat/<?php echo osc_category_id();?>.png" alt="<?php echo osc_esc_html(osc_category_name()); ?>"/>
Title: Re: Alt attribute for images is missing
Post by: Own Petz on November 22, 2022, 12:52:41 PM
thanks for reply ..


But this line not available in inc.category.php
Title: Re: Alt attribute for images is missing
Post by: Own Petz on November 22, 2022, 01:26:30 PM
same code available in inc.search.php , and i have changed that code and now its working

I have changed -

<img src="<?php echo osc_current_web_theme_url();?>images/small_cat/<?php echo osc_category_id();?>.png"/>

to

<img src="<?php echo osc_current_web_theme_url();?>images/small_cat/<?php echo osc_category_id();?>.png" alt="<?php echo osc_esc_html(osc_category_name()); ?>"/>

thanks for Reply ..  :) :)