• Resolved tastenmeister

    (@tastenmeister)


    Hello dear meta-slider team,

    I try to find an option to show title AND description of shown images. I do not mean the slideshow title but the title of the shown images. For now I only see description OR caption, but not both. Can you help here?

    Thanks in advance!

    Regards,
    Tastenmeister

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @tastenmeister

    You will have to use PHP to get this working how you want. Add this to your theme’s function.php file:

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

    From there you can add any html or extra text as needed. Maybe like $slide['caption'] = '<h1>' . $slide['title'] . '</h1>' . $slide['caption'];

    I haven’t tested this directly so let me know if you get an error or it just doesn’t work.

    Thread Starter tastenmeister

    (@tastenmeister)

    Hey kbatdorf,

    thanks again for your help on this issue. I put your code in codesnippet plugin (for me easier to manage instead of editing functions.php). Gave no error so function seems to work. Thanks!!! 🙂

    But just give me one last hint how to use the other code: I’m not sure where to apply your second code snippet.

    Thanks for your help!

    Regards,
    Tastenmeister!

    Hi @tastenmeister

    That second snippet would replace line 2 of the first snippet. The only difference is that it adds the surrounding <h1> in case you need it there.

    I’ll mark this as resolved, but feel free to comment.

    By the way, if you’re enjoying MetaSlider please leave us a 5-star review. They really help us out and let others find our plugin more easily. If you don’t think we deserve the 5 stars please let us know how we can improve, too. Thanks!

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

    Thread Starter tastenmeister

    (@tastenmeister)

    OK, I think I got it.
    I’m very busy these days, but I will try out at the weekend.
    But I’m sure the issue will be fixed now, so you’re right to mark it as resolved.

    If there is any issue I ping you next week.

    Thanks for this great support!

    Regards, Tastenmeister

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Add image title AND description to slideshow’ is closed to new replies.