Viewing 1 replies (of 1 total)
  • This worked, before The Loop with the WordPress Default theme’s index.php:

    <?php
    $types[0] = 'page';
    $types[1] = 'post';
    
    foreach ($types as $type) {
      $args=array(
        'post_type' => $type,
        'post_status' => 'publish,future',
        'showposts' => -1,
        'caller_get_posts'=> 1
        );
      $my_query = null;
      $my_query = new WP_Query($args);
      if( $my_query->have_posts() ) {
        echo 'List of: ' . $type .'(s)';
        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>
         <?php
        endwhile;
      } //if ($my_query)
    } // foreach
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘List All Pages and Posts (quick q)’ is closed to new replies.