WP Nivo Slider
Change caption to Post Title (4 posts)

  1. paulinhapenedo
    Posted 4 years ago #


    WP Nivo Slider display the image title as caption.
    Is there a way of using the post title as caption? I tried to use attributes in the_post_thumbnail(), but it requires me to override the image size and that just broke the plugin.

    The code I tried:

    <?php if(has_post_thumbnail()) : ?>
       <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    	<?php the_post_thumbnail(array(w,h), array ('title'	=> trim(strip_tags( $attachment->post_title )),); ?>
    <?php endif ?>

    Thanks for the help with this awesome plugin!


  2. Lucas Degen
    Posted 4 years ago #

    I think if you go to your jquery.nivo.slider.js to line 107, you can find

    //Create caption
                $('<div class="nivo-caption"><p></p></div>').css({ display:'none', opacity:settings.captionOpacity })

    There you might want to change the title, I did not test it.

  3. alexanderz
    Posted 4 years ago #

    can you tell me more specific about jquery.nivo.slider.js in line 107
    what kind of code that should place to display the title caption?


  4. blitz999
    Posted 4 years ago #

    I'm looking to do exactly the same thing. I can't figure out how the caption works on this to change it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Nivo Slider
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic