WordPress.org

Ready to get started?Download WordPress

Forums

Rotating Tweets (Twitter widget and shortcode)
[resolved] Prev/Next buttons (2 posts)

  1. hurraken
    Member
    Posted 1 year ago #

    Hello,

    At first, thank you for your amazing plugin !

    I'd like to know if it's possible to add prev and next buttons/links under the rotator.

    Thank you for your help.

    Best regards

    http://wordpress.org/extend/plugins/rotatingtweets/

  2. Martin Tod
    Member
    Plugin Author

    Posted 1 year ago #

    It is!

    If you go to lines 472-477 of the rotatingtweets.php file, you should see:

    /* Experiment with Prev / Next buttons
    if($args['show_meta_prev_next']):
    	if(!empty($meta)) $meta .= ' · ';
    	$meta .= '<a href="#" class="rtw_prev">prev</a> &middot; <a href="#" class="rtw_next">next</a>';
    endif;
    */

    Change that to:

    if(!empty($meta)) $meta .= ' &middot; ';
    $meta .= '<a href="#" class="rtw_prev">prev</a> &middot; <a href="#" class="rtw_next">next</a>';

    Then go to /js/rotating_tweet.js and remove /* and */ from lines 41 and 55 leaving:

    jQuery(rotate_id).cycle({
    	pause: 1,
    	height: rotate_height,
    	timeout: rotate_timeout,
    	prev: jQuery(rotate_id).find('.rtw_prev'),
    	next: jQuery(rotate_id).find('.rtw_next'),
    	pager: rotate_id + '_nav',
    	pagerAnchorBuilder: function(idx, slide) {
    		// return sel string for existing anchor
    		return rotate_id + '_nav a:eq(' + (idx) + ')';
    	},
    	fx: rotate_fx
    });

    This should work! If it doesn't, remove:

    pagerAnchorBuilder: function(idx, slide) {
    		// return sel string for existing anchor
    		return rotate_id + '_nav a:eq(' + (idx) + ')';
    	},

    as well!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.