craiggrella
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Fixing WordPress
In reply to: Custom Post Type PaginationOk,
I moved the query under my if statement and got it to work:
here’s the final code I used:function thesis_video_gallery() { if ( is_page('scleroderma-video-gallery') && !is_single() ){ global $post; $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args = (array( 'post_type' => 'videos', 'posts_per_page' => 12, 'caller_get_posts' => 1, 'paged' => $paged )); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); $post_image = thesis_post_image_info('thumb'); query_posts( array( 'post_type' => 'videos', 'posts_per_page' => 12, 'caller_get_posts' => 1, 'paged' => $paged ) ); ?> <div id="vid-gallery"> <div class="vid-thumb"> <a href="<?php $key="lightbox_url"; echo get_post_meta($post->ID, $key, true); ?>" rel="shadowbox" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, 'youtube_thumb', true) ?>" alt="<?php the_title(); ?>"></a></div> <div class="vid-title"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> </div> </div> <?php endwhile; if(function_exists('wp_pagenavi')) wp_pagenavi(); wp_reset_query(); } } add_action('thesis_hook_after_content', 'thesis_video_gallery');
Viewing 1 replies (of 1 total)