Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Created May 19, 2015 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halgatewood/25928d84f8a07006c06c to your computer and use it in GitHub Desktop.
Save halgatewood/25928d84f8a07006c06c to your computer and use it in GitHub Desktop.
Adding CycleTwo Data Arguments to the Testimonial Rotator
// ALL DATA ELEMENTS ARE FOUND HERE: http://jquery.malsup.com/cycle2/api/
// ADD data-cycletwo- TO THE BEGINNING
// NO WRAP FOR ALL ROTATORS
function hg_testimonial_rotator_data_attributes( $default, $template_name, $id )
{
return " data-cycletwo-allow-wrap='false' ";
}
add_filter('testimonial_rotator_data_attributes', 'hg_testimonial_rotator_data_attributes', 10, 3 );
// TARGET SPECIFIC ROTATORS
// WRAP ONLY ROTATOR ID 100
function hg_testimonial_rotator_data_attributes( $default, $template_name, $id )
{
if( $id == 100 ) return " data-cycletwo-allow-wrap='false' ";
else return "";
}
add_filter('testimonial_rotator_data_attributes', 'hg_testimonial_rotator_data_attributes', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment