• Resolved Philip

    (@artdev)


    hi my friends,

    i try to find how i can call a numbers of posts from a custom post type category in the sidebar or other theme templates outside the loop.

    i try to build something like the latest posts widget(that comes pre-build) but to include the custom post type posts.

    is that possible?

    thanks a lot,
    Philip

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php
      query_posts( array( 'post_type' => 'custom_post_type_name', 'showposts' => 10 ) );
      if ( have_posts() ) : while ( have_posts() ) : the_post();
    ?>
    
      <h3><?php the_title(); ?></h3>
    
    <?php endwhile; endif; wp_reset_query(); ?>
    Thread Starter Philip

    (@artdev)

    thanks a lot dogshindleg

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List Posts from Custom Post Types anywhere’ is closed to new replies.