Okay
  Public Ticket #198476
Portfolio Image Title Tag Bug
Closed

Comments

  • non started the conversation

    The code for the featured image, in the portfolio page and in single portfolio page doesn't pick the title of the image. As you can see in the code from the demo the tag is empty.

    <img class="attachment-regular wp-post-image" width="500" height="500" title="" alt="ownage2" src="http://themenectar.com/demo/salient-frostwave/wp-content/uploads/2014/03/ownage21-500x500.jpg" style="top: 0px;">

    This is important for SEO and would be a great fix for everybody.

    Thanks!

  •  8,939
    Tahir replied

    Hey!

    Thanks for the feedback, We will look into it for future updates. 

    Cheers


    ThemeNectar Support Team 

  • Patrick replied

    Do you by any chance use a child theme?

    I remember a issue from long ago where child themes have problems to get the title of images (I have no clue why) 

    anyway if you want a quick fix (until the bug is resolved in future updates) add this to your child's theme (or Salients source)  "functions.php" file at the end of the file just before the "?>" tag (where the php closes

    ===================================================

    add_filter('wp_get_attachment_image_attributes', 'my_img_title', 10, 2);

    function my_img_title($attr, $attachment = null) {

    $attr['title'] = get_post($attachment->ID)->post_title;

    return $attr;

    }

    ===================================================

  • non replied

    Yes, I do use a child theme. 

    Thanks for the fix, it works.

    Cheers!