Forums

Custom Post Types with jQuery Cycle (1 post)

  1. haydenhancock
    Member
    Posted 5 months ago #

    Hello,

    I am using the a custom post type with the jQuery Cycle plugin. Basically, my custom post type is a slideshow and only has images as content. I have the jquery Cycle plugin displaying the custom post type randomly. Everything seems to be working with one minor glitch. When you reload the page, the last post (in the custom post type) is briefly displayed.

    The following is my code:

    jQuery(document).ready(function() {
    	// Slideshow
    	jQuery('#ss').cycle({
    		fx: 'fade',
    		speed: 6000,
    		random: 1
    	});
    });
    <div id="slideshow">
        	<div class="row">
            	<div id="ss" class="column grid_12">
                	<?php $query = new WP_Query( 'post_type=slideshow' ); ?>
    				<?php while ( $query->have_posts() ) : $query->the_post(); ?>
                    <?php remove_filter ('the_content', 'wpautop'); ?>
                    <?php the_content(); ?>
                    <?php endwhile; ?>
                    <?php wp_reset_query(); ?>
                </div>
            </div>
        </div>

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 5 months ago by haydenhancock
  • This topic is not resolved
  • WordPress version: 3.2.1