This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

danads

  • ***
  • 42 posts
Alt attribute for images is missing
« 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

*

MB Themes

Re: Alt attribute for images is missing
« Reply #1 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>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Own Petz

  • ***
  • 32 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: Alt attribute for images is missing
« Reply #2 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.
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

MB Themes

Re: Alt attribute for images is missing
« Reply #3 on: November 19, 2022, 10:14:18 AM »
You will add alt attributes to them
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Own Petz

  • ***
  • 32 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: Alt attribute for images is missing
« Reply #4 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.
« Last Edit: November 20, 2022, 09:09:33 AM by Own Petz »
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

Own Petz

  • ***
  • 32 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: Alt attribute for images is missing
« Reply #5 on: November 21, 2022, 01:45:34 PM »
Waiting for reply..
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

Own Petz

  • ***
  • 32 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: Alt attribute for images is missing
« Reply #6 on: November 22, 2022, 12:21:54 PM »
still waiting , can anyone please suggest me
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

Marked as best answer by frosticek on November 22, 2022, 01:27:17 PM
*

MB Themes

Re: Alt attribute for images is missing
« Reply #7 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()); ?>"/>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Own Petz

  • ***
  • 32 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: Alt attribute for images is missing
« Reply #8 on: November 22, 2022, 12:52:41 PM »
thanks for reply ..


But this line not available in inc.category.php
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

Own Petz

  • ***
  • 32 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: Alt attribute for images is missing
« Reply #9 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 ..  :) :)
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com