using jQuery Cycle by Malsup with WordPress Page and Gallery

I would like to modify a WP Gallery to use the jquery cycle plugin by malsup. I know this is possible but would like to know best practice for this, if anything just pulling out the url for each image should give me enough to work with. Please advise on best practice for this. Note I do not want to use a plugin and would like to build this site on WP Core.

Related posts

Leave a Reply

1 comment

  1. What your asking for has the basic functionality of a plugin, so saying you don’t want to use a plugin doesn’t make much sense.

    If you do for some reason want to write your own , using any jquery or JavaScript is relatively straightforward, you enqueue the script where you want it, then wrap whatever data your using in the javascript tags ( usually a div class or id ). This is a very basic example.
    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

     wp_register_script( 'jquery_cycle_name','http://path-to-your-cycle.js');
     wp_enqueue_script( 'jquery_cycle_name' );
    

    The javascript:

    jQuery(document).ready(function($) {
        $('#featured-works').cycle('fade');
    });
    

    Your template or whatever you wrap your info in, typically you want this in a loop to go through several images/posts or content.

    <div class="featured-work"> images, etc, go here</div>