Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1103257

    hi guys my seo site auditor tool is telling me a logo file on the home page of my site has no alt tag, this file

    https://www.manchestercoachhire.com/wp-content/uploads/2016/02/MANCHESTER-COACH-HIRE-LOGo-web-white-300×82.png

    the site is

    Home

    the filename in question is MANCHESTER-COACH-HIRE-LOGo-web-white-300×82.png

    however i did add it in the media library so how come it isn’t showing? how can i get it to show?

    #1103260

    well that Logo is the alternate logo – set for transparency Option.
    You can add alt and title attribute by child-theme functions.php:

    function custom_alternate_logo_attriubtes(){
    ?>
    <script>
    (function($){
      $('.logo img.alternate').attr({ title:"Manchester Coach Hire Logo", alt:"Manchester Coach Hire" });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_alternate_logo_attriubtes');
    #1103446

    hi i tried to add that but it seems to have not done anything on https://www.manchestercoachhire.com/

    #1103468

    click to enlarge:
    https://i.postimg.cc/k5Mrc4pP/why.jpg

    #1103484

    by the way : if you like to have on logo ( non transparency one) a title tag too – add one line for it above:

    function custom_logo_attriubtes(){
    ?>
    <script>
    (function($){
      $('.logo img').attr({ title:"custom_title", alt:"custom_alt" });
      $('.logo img.alternate').attr({ title:"transparent Logo", alt:"Alt Transparent" });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_logo_attriubtes');
    #1104407

    Hi,

    Thanks for helping out @guenni007, did you manage to get this working @codecreative?

    Best regards,
    Rikard

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