GK Image Show Alt Tags

eCommerce WordPress theme to create online shop with WooCommerce support
GK User
Mon Feb 29, 2016 5:24 am
I am trying to assign an alt tag to the slides on one of my pages.

I have given the slides alt tags in the media library and can see the tags when I inspect my source code but they do not come across as alt tags, they read: data-url="My Alt Tags"

How can I get these to be actual alt tags?

Thanks in advance for your response
User avatar
Fresh Boarder

Joshua M
Mon Feb 29, 2016 9:03 am
Hi,

The Alt Text from media library is used for URL (the link when you click an image). The alt text should be taken from your Caption field (media library)
User avatar
Moderator

GK User
Mon Feb 29, 2016 3:37 pm
Thanks for the reply.

I did put my alt text in the caption field but now it shows as: title="My Alt Tags"

Any other suggestions?
User avatar
Fresh Boarder

Joshua M
Tue Mar 01, 2016 10:15 am
Hi,

Please edit InStyle/js/gk.scripts.js file and change the following line (267):
Code: Select all
var newImg = jQuery('<img title="' + el.text() + '" class="' + el.attr('class') + '" style="' + el.attr('data-style') + '" src="' + el.attr('data-path') + '" data-num="' + i + '" data-url="' + el.attr('data-link') + '" />');

into:
Code: Select all
var newImg = jQuery('<img alt="' + el.text() + '" class="' + el.attr('class') + '" style="' + el.attr('data-style') + '" src="' + el.attr('data-path') + '" data-num="' + i + '" data-url="' + el.attr('data-link') + '" />');


We'll fix the it with the next theme update. Thank you for you feedback.
User avatar
Moderator


cron