Untitled
By: a guest | Mar 19th, 2010 | Syntax:
PHP | Size: 0.49 KB | Hits: 157 | Expires: Never
<?php
/*
Template Name: Custom Type Query Test
*/
// assuming post type 'course' has been created and there is at least one course entry
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query('post_type=course');
$posts = null;
$posts = $wp_query->posts;
//var_dump($posts);
<?php if ($wp_query->have_posts() ) : while ($wp_query->have_posts() ) : $wp_query->the_post(); ?>
<title><?php the_title(); ?></title>
<?php the_content(); ?>
<?php endwhile; endif; ?>
?>