Support » Plugin: MetaSlider » Title of the slide and of the jQuery Lightbox is differing

  • Resolved iorgu

    (@iorgu)



    Hello!

    I have translated the page with Polylang, and I added new slideshows to the new translated site (http://gal-mi.hu/en/home/).

    The problem is that the titles of the slides differ from the titles shown/displayed in the lightbox.
    Somehow I succeeded to sync these two, but only partially, by rewriting the titles according to the language drop-down of the image used in the image editor/upload/”inserter” – this not always works (as for sometimes they are saved for both languages, with the same “title”). Sure it would be even easier if I’d upload the same images with other names and use those for the new site, but that would consume a lot of time.

    Is there a way to make the titles appear the same way in the lightbox as they appear in the editor of the slideshow settings (when the images are the same for two differing slideshows)?

    Thank you in advance!

    • This topic was modified 3 months, 1 week ago by  iorgu.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor kbatdorf

    (@kbat82)

    Hi @iorgu,

    I’m not 100% sure if I understand. Can you refer to this recent thread and let me know if its the same situation?

    https://wordpress.org/support/topic/displaying-the-slideshow-title/

    Hi @kbat82,
    thank you for your reply. It is not the same situation.
    I’ll try to recompose and re-describe my problem:
    So as it can be seen, on the site (http://gal-mi.hu/en/home/) inside the “Reconstruction: photos before and after”, the third slide has the title: “Replacement of VIPA-made remote IO devices to Siemens ET200. (2)” and when clicking on it is shown in the lightbox differently under the image: “VIPA gyártmányú kihelyezett IO eszközök cseréje Siemens ET200-ra. (2.)”. This is also with some other slides. I would like to specify the same title in the editor given in Metaslider.

    So it seems to be a bug or something, because the titles are not the same in the lightbox as it is given by me in the Metaslider editor of the slides.

    @kbat82, Or are you referring that titles will appear properly in the lightbox if I add the get_the_title(‘12345’); to the shortcode somehow?

    • This reply was modified 3 months, 1 week ago by  iorgu.
    Plugin Contributor kbatdorf

    (@kbat82)

    Hi @iorgu,

    Did you find a solution for this already? I checked you’re site and I’m not sure if you have it working now.

    When you say “title” do you meant the title that’s in the markup, or the caption that appears under the image?

    When we build the slides, we use the title that’s assigned to the image that’s built into WP, unless you override the title in the provides box (under the SEO tag). The same goes for the caption.

    Did you want to use the title as a caption instead of the actual caption? This is also possible but a little advanced. You could try adding this to your functions.php file:

    add_filter('metaslider_image_slide_attributes', function($slide, $slideshow_id, $settings) {
      $slide['caption'] = $slide['title'];
      return $slide;
    });

    Hi dear @kbat82,

    Oh sorry, it really is the “Caption” that I was referring to.

    The only solution would be for me (as far as I see to be working) is to upload different image files for the two other slideshows (which would be the English ones), but that would take a lot of time, effort and not too easily manageable files and filenames.

    I would just like the caption (as title) to match the title under the image that appears in the lightbox.

    The main problem is that there are to different languages but the images are the same. It would really not make sense otherwise to have two different titles/captions for them, unfortunately now there is (sense).

    When I delete the “title” under the “Attachment Details” at the “Select Replacement Image”, the “title” disappears under the slide when opened in the lightbox, and caption has no relevance in this case; it doesn’t display too, as for the title was the one that was displaying instead of the caption given in the slide.

    What code would I need to add to the functions.php (or to the shortcode) to make the captions appear inside the lightbox instead of the titles?

    Thank you very much for your time and effort given in helping me!

    Plugin Contributor kbatdorf

    (@kbat82)

    Hi @iorgu,

    You should be able to just reverse the code I pasted above. This just overrides the output:

    add_filter('metaslider_image_slide_attributes', function($slide, $slideshow_id, $settings) {
      $slide['title'] = $slide['caption'];
      return $slide;
    });

    Hi @kbat82,

    Thank you,
    I tried your code into the Custom PHP inserter (My Custom Functions by Space X-Chimp) and it gives me:

    “Sorry, but your code causes a “Fatal error”, so it is not applied!
    Please, check the code and try again. ”

    The place for it looks like this:

    <?php
    // your code here

    ?>

    What next? Thanks!

    @iorgu it also can be without:

    <?php
    // your code here

    ?>

    Plugin Contributor kbatdorf

    (@kbat82)

    Hi @iorgu,

    Did you put the code inside of the <?php tag?

    You might have an old version of PHP maybe? In that case this code might work:

    add_filter('metaslider_image_slide_attributes', 'iorgu_update_title_attribute');
    function iorgu_update_title_attribute($slide, $slideshow_id, $settings) {
      $slide['title'] = $slide['caption'];
      return $slide;
    }

    Hi @kbat82,

    I placed it inside <?php tag, but now it outputs:

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 2 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    Warning: Missing argument 3 for iorgu_update_title_attribute() in /home/galkft1/web/wp-content/plugins/my-custom-functions/inc/php/functional.php(85) : eval()’d code on line 3

    • This reply was modified 3 months, 1 week ago by  iorgu. Reason: clearing
    Plugin Contributor kbatdorf

    (@kbat82)

    Okay try removing the two extra params:

    add_filter('metaslider_image_slide_attributes', 'iorgu_update_title_attribute');
    function iorgu_update_title_attribute($slide) {
      $slide['title'] = $slide['caption'];
      return $slide;
    }

    Thank you so much, flawless (!!!), dear @kbat82, it worked like a charm! (-:

    Plugin Contributor kbatdorf

    (@kbat82)

    Awesome! Glad it’s working now.

    By the way, if you’re enjoying the MetaSlider plugin please leave us a 5-star review. They really help us out (if you feel it’s not worth that, please do let us know how we can improve). Thanks!

    https://wordpress.org/support/plugin/ml-slider/reviews#new-post

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.