WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. paulinhapenedo
    Member
    Posted 3 years ago #

    Guys,

    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 )),); ?>
       </a>
    <?php endif ?>

    Thanks for the help with this awesome plugin!

    http://wordpress.org/extend/plugins/wp-nivo-slider/

  2. Lucas Degen
    Member
    Posted 3 years ago #

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

    //Create caption
            slider.append(
                $('<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
    Member
    Posted 3 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?

    thanx..

  4. blitz999
    Member
    Posted 2 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

About this Topic