Rufusmedia
1/9/2013 - 9:44 PM

PHP-WORDPRESS-CUSTOM_POST_TYPE_QUERY

PHP-WORDPRESS-CUSTOM_POST_TYPE_QUERY

            <?php 
            $temp = $wp_query; 
            $wp_query = null; 
            $wp_query = new WP_Query(); 
            $wp_query->query('showposts=5&post_type=testimonials'.'&paged='.$paged); 
            while ($wp_query->have_posts()) : $wp_query->the_post(); 
            ?>

                <article class="post clearfix" id="post-<?php the_ID(); ?>">
                    <div class="testimonial-content">
                    <?php the_content(); ?>
                    </div><!-- end .post-content -->
                    <div class="testimonial-title">
                        <p><?php the_title(); ?></p>
                    </div><!-- end .post-meta --> 
                </article><!-- end .post -->

            <?php endwhile; ?>

                <div class="pagination">
                    <?php rufus_pagination(); ?>
                </div><!-- /.pagination -->

            <?php 
            $wp_query = null; 
            $wp_query = $temp;  // Reset
            ?>