PDA

View Full Version : Problems with Show Image Title as Description



rashawn336
12-31-2012, 02:57 PM
description is coming in as undefined. also the image title is not showing. please help.

rashawn336
01-01-2013, 10:23 PM
hello??? anyone???

woods
01-03-2013, 09:22 AM
Hi rashawn336,

What version of Social Gallery is this? Please make sure you are using the latest (v2.0 (http://www.socialgalleryplugin.com/social-gallery-version-2-0-released/) available from your Code Canyon download screen) and if you are still hitting this issue (after installing v2.0 and doing a full library scan under "Update engine") then please do post your URL here.

rashawn336
01-03-2013, 12:52 PM
Im using 2.0. but its doing the same thing with the last version. infographcreative.com/lbtTEST/?p=9#_

raajbrar
01-03-2013, 07:58 PM
Hi rashawn336,

What version of Social Gallery is this? Please make sure you are using the latest (v2.0 (http://www.socialgalleryplugin.com/social-gallery-version-2-0-released/) available from your Code Canyon download screen) and if you are still hitting this issue (after installing v2.0 and doing a full library scan under "Update engine") then please do post your URL here.

I am having the same issue, 'Undefined'. See image attached. 3

See URL: southasianlife.com/who-is-your-celebrity-party-twin/

rashawn336
01-07-2013, 07:46 PM
any solutions????

grizgza
01-08-2013, 04:23 PM
Hi rashawn336,

What version of Social Gallery is this? Please make sure you are using the latest (v2.0 (http://www.socialgalleryplugin.com/social-gallery-version-2-0-released/) available from your Code Canyon download screen) and if you are still hitting this issue (after installing v2.0 and doing a full library scan under "Update engine") then please do post your URL here.

I'm also having the same exact issue. I'm using the latest version 2.0 and have completed a full library scan.
grizfam.com/2013/01/beauty-in-an-alley/
You can login via a Facebook account or register for a new account manually, to view the page.

WP Lightbox was using the image titles just fine (it is now deactivated).

Please let me know what could be causing this.

Thanks
Justin

woods
01-09-2013, 03:14 PM
Hi All,

Looking at your examples I would hazard a guess that it's either the other lightboxes clashing or a javascript error - I was sure I nailed this bug in v1.5 (never released) and v2.0 - It's strange that it's come back.

*some time later, after investigating* OK I see what's happening. You all have some funny combination of settings regarding the social deck (likes, tweet etc) which is creating this bug - Could you do me a favour and share your settings please? (Ideally provide me with a screenshot of your settings->social)

Cheers all - I am sure we will be able to get this sorted!

grizgza
01-09-2013, 05:04 PM
Hi All,

Looking at your examples I would hazard a guess that it's either the other lightboxes clashing or a javascript error - I was sure I nailed this bug in v1.5 (never released) and v2.0 - It's strange that it's come back.

*some time later, after investigating* OK I see what's happening. You all have some funny combination of settings regarding the social deck (likes, tweet etc) which is creating this bug - Could you do me a favour and share your settings please? (Ideally provide me with a screenshot of your settings->social)

Cheers all - I am sure we will be able to get this sorted!

Thanks for looking into this. Here is a screenshot of my current settings > social

grizgza
01-09-2013, 06:04 PM
OK, I did some digging around on this. It turns out the that image thumbnails in my galleries do not have the "title" attribute on the img tags. The image description is in the alt tag instead.


<img width="950" height="628" src="http://grizfam.com/wp-content/uploads/2013/01/DSC03392-950x628.jpg" class="attachment-full-post-thumbnail wp-post-image" alt="Leaves on the deck" />

Social Gallery grabs the description from the TITLE attribute, not the ALT attribute. If I add title="xyz" it shows correctly in the lightbox. My galleries are created in my template files via


<?php echo do_shortcode('[gallery link="file" columns="5"]'); ?>

I suspect this may have something to do with the difference in how the gallery image tags are rendered, but I haven't looked into it just yet.

The UNDEFINED thing is a different issue. This involves the sharing options activated. If I activate Google+ or Tumblr, etc... the 'undefined' message goes away. It seems to show when they are all turned OFF, or different combinations are turned OFF.

Hope this helps.

grizgza
01-09-2013, 06:30 PM
This is relevant:
http://blog.maximusbusiness.com/2012/12/adding-image-title-in-image-link-title-attribute/

WordPress (in version 3.5) decided to remove the image titles from the output, after adding images to the editor.


$title = ''; // We no longer insert title tags into <img> tags, as they are redundant.

I think you're going to have to change the way you grab image titles to use in the Social Gallery lightbox...

grizgza
01-09-2013, 08:02 PM
Someone has created a plugin to restore the title attribute to the HTML output of image tags:
http://wordpress.org/support/topic/restoring-titles-to-inserted-images-in-wordpress-35?replies=10#post-3707607
This didn't work for my gallery images, however. The code I used for that is (in functions.php):


//Add title attribute back to gallery images
function my_image_titles($atts,$img) {

$atts['title'] = trim(strip_tags( $img->post_title ));

return $atts;
}
add_filter('wp_get_attachment_image_attributes','m y_image_titles',10,2);

To get rid of the 'undefined', for now I just did this with CSS, adding this to my theme's style.css:


#sgSocial {
display: none !important;
}

kashifbunty
01-12-2013, 04:50 PM
Good Day thanks for the useful plugin. I am having problem in image description its not showing the description of any image just showing undefined kindly tell me how to set this you can see my website fottolotto.com kindly reply me in detail then i will set my image description settings.
Second question is as you can see my website is a image voting website. I need to put the vote option in lightbox can you please tell me where to edit and paste my voting codes to set up my voting on lightbox zoom image.
I will wait for you reply please reply me quick i will be very thankful to you.

kashifbunty
01-14-2013, 10:27 AM
I am waiting for your answer since 2 days but you did't answer my question. Please answer this question
I am having problem in image description its not showing the description of any image just showing undefined kindly tell me how to set this you can see my website fottolotto.com kindly reply me in detail then i will set my image description settings.
Second question is as you can see my website is a image voting website. I need to put the vote option in lightbox can you please tell me where to edit and paste my voting codes to set up my voting on lightbox zoom image.
I will wait for you reply please reply me quick i will be very thankful to you.

woods
01-16-2013, 12:55 PM
Someone has created a plugin to restore the title attribute to the HTML output of image tags:
http://wordpress.org/support/topic/restoring-titles-to-inserted-images-in-wordpress-35?replies=10#post-3707607
This didn't work for my gallery images, however. The code I used for that is (in functions.php):


//Add title attribute back to gallery images
function my_image_titles($atts,$img) {

$atts['title'] = trim(strip_tags( $img->post_title ));

return $atts;
}
add_filter('wp_get_attachment_image_attributes','m y_image_titles',10,2);

To get rid of the 'undefined', for now I just did this with CSS, adding this to my theme's style.css:


#sgSocial {
display: none !important;
}



Grizgza - Thanks very much for putting in the time to help out and work on solving this one - it's great to see your getting there.

For certain in future Social Gallery will deal better with descriptions - I'll sure up this title/alt issue and I also want to make a far cooler "Descriptions Mutator" which will let you build custom descriptions (and add paypal buttons, insert excerpts from page, html, etc.) if enough people want it.

Are you sorted now or is there anything I can help with?



Thanks again for sharing so kindly.


Woody

woods
01-16-2013, 01:00 PM
I am waiting for your answer since 2 days but you did't answer my question. Please answer this question
I am having problem in image description its not showing the description of any image just showing undefined kindly tell me how to set this you can see my website fottolotto.com kindly reply me in detail then i will set my image description settings.
Second question is as you can see my website is a image voting website. I need to put the vote option in lightbox can you please tell me where to edit and paste my voting codes to set up my voting on lightbox zoom image.
I will wait for you reply please reply me quick i will be very thankful to you.

Hi kashifbunty,

Please do be patient - I deal with support tickets as quickly as I can.

The problem you are having is a tiny bug with the added Social Deck of Social Gallery v2.0 - I believe it's because you have all the social sharing elements turned off and it's on my fix list at the top for v2.1, turning on any of the first few sharing services will temporarily fix it, but please bear with me for a pro fix.

Nice gallery by the way - some cool pictures!



Woody

grizgza
01-16-2013, 03:39 PM
Grizgza - Thanks very much for putting in the time to help out and work on solving this one - it's great to see your getting there.

For certain in future Social Gallery will deal better with descriptions - I'll sure up this title/alt issue and I also want to make a far cooler "Descriptions Mutator" which will let you build custom descriptions (and add paypal buttons, insert excerpts from page, html, etc.) if enough people want it.

Are you sorted now or is there anything I can help with?



Thanks again for sharing so kindly.


Woody

Yes, with some tweaks I've now got everything working the way I wanted it on my site.

A better (temporary) CSS solution for the 'undefined' is to make Google+ active in the Social settings which will fix the 'undefined' error, then selectively hide the containing div for the Google+ button (if you don't want it). This way you can still have the Facebook like buttons displayed, rather than hiding the whole #sgSocial div altogether like I suggested earlier.



#sgGoog {
display: none !important;
}

woods
01-17-2013, 12:53 PM
Grizgza,

Great idea for a quick fix! Thanks again for sharing. This is top of the list to fix in v2.1 so I'll get it sorted soon.



Cheers

Woody

bartgatsby
01-22-2013, 01:24 AM
Hi Woods, I have the same problem. I use the latest version. There's no title and description on the lightbox. Set it to automatically show image description. So we can put at least 1 paragraph desciption(not just 1 sentence) coz google adsense hate a page with no or only 1 sentence.

woods
01-23-2013, 05:31 AM
Hi bartgatsby,

Thanks for your input - the problem with descriptions is that they are not always put out into the code by WordPress, so inserting them into the gallery isn't straight forward. I'll do my best to think of a workaround/way forward though, but for now I advise using the title attribute!




Cheers

Woody

Ezia
05-27-2013, 10:03 AM
Someone has created a plugin to restore the title attribute to the HTML output of image tags:
http://wordpress.org/support/topic/restoring-titles-to-inserted-images-in-wordpress-35?replies=10#post-3707607
This didn't work for my gallery images, however. The code I used for that is (in functions.php):


//Add title attribute back to gallery images
function my_image_titles($atts,$img) {

$atts['title'] = trim(strip_tags( $img->post_title ));

return $atts;
}
add_filter('wp_get_attachment_image_attributes','m y_image_titles',10,2);

}[/HTML]

Is this code restore the title attribute ? It's doesn't work in my site... Where do i have to use this code ? which fonction.php and where ? can you help me ?
Thanks
Ezia

mikemayhem3030
05-28-2013, 11:43 AM
I've not tested this myself, but it would go in your theme's functions.php (under Appearance -> Editor)

Ezia
05-28-2013, 01:12 PM
We've tryed many ways to solve the problem. It still doesn't work, the grey bar above the photo shows up but the photo title doesn't.
Have you find a way to solve this?

mikemayhem3030
05-29-2013, 08:25 AM
Hi

This thread gives you all the details you'll need to workaround the issue until the next update. It's on the list to look at for v3.0 but that won't be anytime soon so anything like this you'll need to employ the workarounds detailed here.

Sorry I can't be of more help, you could try other ways to output photos on your site (like WordPress gallery if you're not using it) (add media, create gallery, add link = "file" to the shortcode)

Mike