* Template Name: Movies

<?php get_header(); ?>

        <div id="container">
            <div id="content">

$type = 'movies';
  'post_type' => $type,
  'post_status' => 'publish',
  'posts_per_page' => -1,
  'caller_get_posts'=> 1
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
  while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
wp_reset_query();  // Restore global post data stomped by the_post().
            </div><!-- #content -->
        </div><!-- #container -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
  • What do you mean by not displaying anything. Are there no posts displayed, is whole page not displaying? Please update your question Apr 4, 2014 at 9:51
  • In the future, please try to improve the quality of your questions, by including a description of basic debugging efforts. Simply setting WP_DEBUG to true would have identified the root cause in this case. Apr 4, 2014 at 12:50

1 Answer 1

Please try with `ignore_sticky_posts` instead of `caller_get_posts` which is deprecated.
  • Hi........ i tried your code and it is working fine ....... make sure you have selected the correct template from "page attributes" as well as the post_type name is correct.
    – Anoop D
    Apr 4, 2014 at 9:54
  • 3
    caller_get_posts is as dead as the dinosaurs. Funny to see how many developers still use this. Don't developers set debug to true anymore, as this would have been picked up by just this simple setting Apr 4, 2014 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.