add "alt" attribute for post thumbnail image for SEO purpose

Discussion in 'Infoway WordPress Theme' started by satemorej, Sep 21, 2015.

Thread Status:
Not open for further replies.
  1. satemorej

    satemorej New Member

    Joined:
    Feb 22, 2014
    Messages:
    20
    Likes Received:
    0
    hello inkthemes
    my SEO verifying tools can't find alt attribute on the post thumbnails.
    I found out that it could be set in infoway/functions/inkthemes-functions.php file at line 168.
    But I don't know how to get alt attribute value of the images. I guess it should look like $image[something].

    Thank you for your help
    Best regards
    Jerome
     
  2. nitin

    nitin Guest

    Hi,

    Greetings from InkThemes,

    It would be our pleasure to serve you.

    Could you please provide us URL of your website along with some edited screenshot of your requirements, so that we can assist you accordingly?

    We would be glad to assist you.

    Thanks & Regards!
    Nitin
    InkThemes.com
     
  3. starkow

    starkow Member

    Joined:
    Feb 26, 2015
    Messages:
    48
    Likes Received:
    0
    I need these too.
     
  4. priya

    priya Guest

    Hello,

    Greetings from InkThemes!

    Please follow the screenshot given below.

    infoway_thumbnail.png

    Hope it will resolve your issue

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  5. satemorej

    satemorej New Member

    Joined:
    Feb 22, 2014
    Messages:
    20
    Likes Received:
    0
    Hello Priyanka
    Thanks for your help.
    Your screenshot is nearly what I need. Instead of the post title (the_title_attribute()), I need to get the alt attribute of the image I selected in my media library. As I am a newbie in web development, I don't know what data to use.
    Like width='$image[width]' height='$image[height]' are used to get image size, I guess there should
    be a alt='$image[SOMETHING_I_DONT_KNOW]' to get the alt text. Best regards, Jerome
     
  6. priya

    priya Guest

    Hello,

    You can add your alt attribute of the image from the media section as I have mentioned in the screenshot given below.

    infoway_alt_text.png

    Hope it will resolve your issue

    Do let me know if you need more assistance,

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  7. satemorej

    satemorej New Member

    Joined:
    Feb 22, 2014
    Messages:
    20
    Likes Received:
    0
    Hello
    Thanks for your help. I am now OK with setting an alt text to an image attachment.
    But my need is to pick this alt text from the sql database so as to use it in the inkthemes_functions.php file (at line #169) instead of the_title_attribute() you give as example i your first screenshot.

    best regards
    Jerome
     
  8. priya

    priya Guest

    Hello Jerome,

    When you set the alt text of any image as I mentioned above in screenshot, that text will store in the database.

    So firstly you have to set the alt text.

    Hope you will get my point.

    Do let me know if you need more assistance,
    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  9. satemorej

    satemorej New Member

    Joined:
    Feb 22, 2014
    Messages:
    20
    Likes Received:
    0
    hello Priyanka
    Thanks again for your help.
    I looked deeper into wordpress and infoway theme and I wrote the following which makes me happy with SEO regarding alt attribute of my images.

    function inkthemes_get_thumbnail($iw, $ih) {
    $permalink = get_permalink();
    $thumb = get_post_thumbnail_id();
    $image = inkthemes_thumbnail_resize($thumb, '', $iw, $ih, true, 90);
    /* JT */
    $imgalt = get_post_meta( $thumb, '_wp_attachment_image_alt', true );


    if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) {
    print "<a href='$permalink'><img class='postimg' src='$image' width='$image[width]' height='$image[height]' alt='$imgalt'/></a>";
    }
    }
    This topic is closed from my point of view
    Best regards[/COLOR]
     
  10. priya

    priya Guest

    Hello,

    Awesome!

    Thank you so much to share your knowledge with us...

    I really appreciate your efforts to exploring the things...

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
Thread Status:
Not open for further replies.

Share This Page