Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Show Master-Class post type if it is Master-Class
- //query_posts($query_string . '&post_type=master_class&posts_per_page=3&paged=$paged');
- $type = 'master_class';
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $args=array(
- 'post_type' => $type,
- 'post_status' => 'publish',
- 'paged' => $paged,
- 'posts_per_page' => 3,
- 'caller_get_posts'=> 1
- );
- $temp = $wp_query; // assign original query to temp variable for later use
- $wp_query = null;
- $wp_query = new WP_Query();
- $wp_query->query($args);
- ?>
- <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>
- <div id="post-<?php the_ID(); ?>" class="master_item">
- <div class="post_main_img">
- <?php
- if ( has_post_thumbnail() ) {
- the_post_thumbnail('single-post-thumbnail');
- }
- ?>
- </div>
- <div class="master_item_content">
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <?php
- $master_info = get_post_meta($post->ID, 'master_info', true);
- if ($master_info !== '') {
- echo $master_info;
- }
- ?>
- </div>
- <div class="clear"> </div>
- </div>
- <?php endwhile; else :// End the loop. Whew. ?>
- <div id="post-0" class="post error404 not-found">
- <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
- <div class="entry-content">
- <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
- <?php get_search_form(); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-0 -->
- <?php endif; ?>
- <?php /* Display navigation to next/previous pages when applicable */ ?>
- <?php if ( $wp_query->max_num_pages > 1 ) : ?>
- <div id="nav-above" class="navigation">
- <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
- <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
- </div><!-- #nav-above -->
- <?php endif; $wp_query = null; $wp_query = $temp;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement