WordPress.org

Ready to get started?Download WordPress

Forums

Image Widget
Add img title attribute (6 posts)

  1. ZeroGravity
    Member
    Posted 2 years ago #

    Could you add the "alt" text to the img "title" attribute as well. Firefox and Chrome don't display the alt text, they display the text in the title attribute.

    http://wordpress.org/extend/plugins/image-widget/

  2. pixelyzed
    Member
    Posted 1 year ago #

    Hi!

    I would need this as well but, not on the image. The title attribute usually goes on the link tag (a href=). This would be awesome!

  3. javiandgo
    Member
    Posted 1 year ago #

    ZeroGravity: to show Alt attribute as title add this title="'.$alt.'" on line 15 of your widget.php, after href="'.$link.'"

    This also applies for the title if it is defined as a link, pixelyzed can search support how to add the link to the title.

  4. Modern Tribe, Inc.
    Member
    Plugin Author

    Posted 1 year ago #

    This is a great idea. We're going to sneak this in the impending WP 3.5+ support update. We're also adding a filter called 'image_widget_link_attributes' that will work in much the same way that 'wp_get_attachment_image_attributes' works so that you can easily insert your own link attributes.

  5. javiandgo
    Member
    Posted 1 year ago #

    great!, this will be easier for those who do not know the code.

  6. ZeroGravity
    Member
    Posted 1 year ago #

    This will be great. I had thought about updating widget.php but didn't want another plugin where I needed to keep track of customizations I had made. It becomes a bit of pain in the neck when update time rolls around.

    I understand about having the title attribute on the link. Something I have noticed with Chrome and Firefox is if you have an image without a link around it they don't display the alt attribute of the image. If you add a title attribute to the image as well up pops the text.

    I have a dream. That one day all browsers will behave the same. Ok, back to reality. ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic