WordPress.org

Support

Support » Plugins and Hacks » Slideshow » [Resolved] How to add get caption data as well as description?

[Resolved] How to add get caption data as well as description?

  • My site is loading different translations (i.e. text) depending on a cookie that is set when the user chooses a language.

    I need to be able to use the same gallery but just change the description text when the cookie is set. In what file in the plugin can I make the $slide array contain the caption text (which is a field in the image in media library). Also, what file I can add my conditional statement in:

    if($language == 'polish'){
         echo $slide['caption'];
    else{
         echo $slide['description'];
    }

    Hope that makes sense.

    http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stefan Boonstra

    @stefanboonstra

    In version 2.1.23 of the Slideshow plugin the file can be found in ‘yoursite.com/wp-content/plugins/slideshow-jquery-image-gallery/views/SlideshowPlugin/slideshow.php‘. Look for lines 80 through 83. These lines set the title and description for the image slides. I think you may want to make the code look something like this:

    if(empty($title))
    	$title = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($attachment->post_title);
    if($language == 'polish')
    	$description = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($attachment->post_excerpt);
    elseif(empty($description))
    	$description = SlideshowPluginSecurity::htmlspecialchars_allow_exceptions($attachment->post_content);

    The disadvantage of this approach is that you cannot update the Slideshow plugin, as it would overwrite the changes you’ve made to its files.

    I would personally prefer creating a slideshow for every language, performing the ‘$language’ check in my post, page or theme. There are a couple of language plugins that can help with that.

    Thats great thank you so much. I was looking everywhere last night for the right file. Brilliant plugin, thank you.

    I know it would be better not to edit the plugin, but it will confuse my client if she has multiple galleries for what she sees are the same page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to add get caption data as well as description?’ is closed to new replies.
Skip to toolbar