Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php
    $custom_post_type = 'book';
    $args=array(
      'post_type' => $custom_post_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() ) {
      echo 'List of Books';
      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;
    }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>
    Thread Starter hoss9009

    (@hoss9009)

    this is for the wp-post-type-ui?
    If so, thank you!

    That can be used for post_types created either with that plugin and if done manually with register_post_type in your theme’s functions.php template.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP Post Type UI] Custom Post loop?’ is closed to new replies.