Support » Themes and Templates » the_post_thumbnail and ALT tag

  • Hi All,
    Can anyone clarify on ALT tag display?

    I’ve read various tuts available on net but still can’t figure out why Alt tag is not displayed by default.

    Here is my code
    the_post_thumbnail(array(180,90), array( “class” => “alignleft post_thumbnail”));

    Above code shows title tag but doesn’t show ALT tag, it shows alt=””

    When I use following code
    the_post_thumbnail(array(180,90), array( ‘alt’ => ‘alttext’, ‘title’ => ‘titletext’, “class” => “alignleft post_thumbnail”));

    I get alt=”alttext”

    Anyone to solve this?

Viewing 1 replies (of 1 total)
  • array( 'alt' => 'alttext',

    right here…you are specifying that alt reads ‘alttext’

    so the output you are getting is exactly correct? It’s what you told it to output…What are you wanting?

    with the post_thumbnail, I believe, title is automatically set….from the wording when you insert the picture

    unless you do this (your second example)
    'title' => 'titletext', which would override the default title and instead make it ‘titletext’…exactly what you tell it!

Viewing 1 replies (of 1 total)
  • The topic ‘the_post_thumbnail and ALT tag’ is closed to new replies.