title: Get all posts from a Custom Post Type
body: <p>I'm using <a href="https://wordpress.org/plugins/types/" rel="nofollow">WP Types Plugin</a> and all works fine, now I need to show the contents created through that plugin and this is how I'm doing:</p>
  
  <pre><code>$args = array(
      'posts_per_page'   =&gt; 15,
      'category_name'    =&gt; 'legislacion',
      'orderby'          =&gt; 'post_date',
      'order'            =&gt; 'DESC',
      'post_type'        =&gt; 'post',
      'post_status'      =&gt; 'publish',
      'suppress_filters' =&gt; true
  );
  
  $legislacion_posts = get_posts( $args );
  ?&gt;
  
  &lt;ul&gt;
      &lt;?php foreach ( $legislacion_posts as $post ) : setup_postdata( $post ); ?&gt; ?&gt;
          &lt;li&gt;
              &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
          &lt;/li&gt;
      &lt;?php endforeach;
      wp_reset_postdata(); ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>But I'm not getting the posts from that category, why?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the content of <code>archive-legislaciones.php</code> file:</p>
  
  <pre><code>&lt;?php
  
  // Exit if accessed directly
  if ( ! defined( 'ABSPATH' ) ) {
      exit;
  }
  
  /**
   * Pages Template
   *
   *
   * @file           archive-legislaciones.php
   * @package        Responsive
   * @author         Emil Uzelac
   * @copyright      2003 - 2013 ThemeID
   * @license        license.txt
   * @version        Release: 1.0
   * @filesource     wp-content/themes/responsive/page.php
   * @link           http://codex.wordpress.org/Theme_Development#Pages_.28page.php.29
   * @since          available since Release 1.0
   */
  ?&gt;
  &lt;?php get_header(); ?&gt;
  &lt;?php if ( is_page( 'legislaciones' ) ) { ?&gt;
      &lt;div id="content" class="grid col-620"&gt;
      &lt;?php
      $args = array(
          'posts_per_page'   =&gt; 15,
          'category_name'    =&gt; 'legislacion',
          'orderby'          =&gt; 'post_date',
          'order'            =&gt; 'DESC',
          'post_type'        =&gt; 'post',
          'post_status'      =&gt; 'publish',
          'suppress_filters' =&gt; true
      );
  
      $legislacion_posts = get_posts( $args );
      ?&gt;
  
      &lt;ul&gt;
          &lt;?php foreach ( $legislacion_posts as $post ) : setup_postdata( $post ); ?&gt;
              &lt;li&gt;
                  &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
              &lt;/li&gt;
          &lt;?php endforeach;
          wp_reset_postdata(); ?&gt;
      &lt;/ul&gt;
      &lt;/div&gt;
      &lt;?php get_sidebar(); ?&gt;
  &lt;?php } ?&gt;
  &lt;?php get_footer(); ?&gt;
  </code></pre>
  
  <p>Something is wrong there?</p>