title: Loop specific category of a custom post type in wordpress
body: <p>Just fixed it.... the problem was in</p>
  
  <pre><code>    register_taxonomy_for_object_type( 'tags', 'produto' );
  </code></pre>
  
  <p>was registering tags instead of categories.... fixed with:</p>
  
  <pre><code>&lt;?php
                                                  $tag = 'taeq';
                                                  $args = array('post_type' =&gt; 'produto', 'posts_per_page' =&gt; -1, 'produto_category' =&gt; $tag);
                                                  $loop = new WP_Query($args);
                                                  while ($loop-&gt;have_posts()) : $loop-&gt;the_post(); ?&gt;
                                                      &lt;li&gt;
                                                          &lt;img src="&lt;?php the_field('produto_img'); ?&gt;" alt="&lt;?php the_title(); ?&gt;" /&gt;
                                                          &lt;span&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;
                                                          &lt;span&gt;&lt;?php the_field("produto_desc"); ?&gt;&lt;/span&gt;
                                                          &lt;i class="border"&gt;&lt;/i&gt;
                                                      &lt;/li&gt;
                                                  &lt;?php endwhile; ?&gt;
  </code></pre>
  
  <p>The correct question was how to Loop specific tag of a custom post type in wordpress</p>
  
  <p>I'm trying to loop posts from only one category on wordpress.</p>
  
  <p>I don't know nothing about PHP...</p>
  
  <p>Here is the code I have, working, but displaying all the products</p>
  
  <pre><code>&lt;?php 
  $new_query = new WP_Query('post_type=produto&amp;post_per_page=-1');
  while($new_query -&gt; have_posts()) : $new_query -&gt; the_post();
  ?&gt;
  &lt;li&gt;
      &lt;img src="&lt;?php the_field("produto_img"); ?&gt;" alt="&lt;?php the_title(); ?&gt;" /&gt;
      &lt;span&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;
      &lt;span&gt;&lt;?php the_field("produto_desc"); ?&gt;&lt;/span&gt;
      &lt;i class="border"&gt;&lt;/i&gt;
  &lt;/li&gt;
  
  &lt;?php endwhile; ?&gt;
  </code></pre>
  
  <p>I need show items from category ID 2.</p>
  
  <p>what should I do?</p>
  
  <p>OBS: My site is a singlepage website.
  I'm displaying all the posts types in differents places of the same page.
  need filter some by category.</p>
  
  <p>functions php:</p>
  
  <pre><code>add_action( 'init', 'create_post_type_produto' );
  function create_post_type_produto() {
      $labels = array(
          'name' =&gt; _x('Produtos', 'post type general name'),
          'singular_name' =&gt; _x('Produtos', 'post type singular name'),
          'add_new' =&gt; _x('Adicionar novo', 'produto'),
          'add_new_item' =&gt; __('Adicionar novo produto'),
          'edit_item' =&gt; __('Editar produto'),
          'new_item' =&gt; __('Novo produto'),
          'all_items' =&gt; __('Todos os produtos'),
          'view_item' =&gt; __('Ver produtos'),
          'search_items' =&gt; __('Procurar produtos'),
          'not_found' =&gt;  __('Nenhum produto encontrado'),
          'not_found_in_trash' =&gt; __('Nenhum produto encontrado na lixeira.'),
          'parent_item_colon' =&gt; '',
          'menu_name' =&gt; 'Produtos'
      );
      register_post_type( 'produto', array(
          'labels' =&gt; $labels,
          'public' =&gt; true,
          'publicly_queryable' =&gt; true,
          'show_ui' =&gt; true,
          'show_in_menu' =&gt; true,
          'has_archive' =&gt; 'produtos',
          'rewrite' =&gt; array(
           'slug' =&gt; 'produtos',
           'with_front' =&gt; false,
          ),
          'capability_type' =&gt; 'post',
          'has_archive' =&gt; true,
          'hierarchical' =&gt; false,
          'menu_position' =&gt; null,
          'supports' =&gt; array('title')
          )
      );
      register_taxonomy( 'produto_category', array( 'produto' ), array(
          'hierarchical' =&gt; true,
          'label' =&gt; __( 'Categoria do produto' ),
          'labels' =&gt; array( // Labels customizadas
          'name' =&gt; _x( 'Categorias', 'taxonomy general name' ),
          'singular_name' =&gt; _x( 'Categoria', 'taxonomy singular name' ),
          'search_items' =&gt;  __( 'Procurar categorias' ),
          'all_items' =&gt; __( 'Todas categorias' ),
          'parent_item' =&gt; __( 'Categoria pai' ),
          'parent_item_colon' =&gt; __( 'Categoria pai:' ),
          'edit_item' =&gt; __( 'Editar categoria' ),
          'update_item' =&gt; __( 'Atualizar categoria' ),
          'add_new_item' =&gt; __( 'Adicionar nova categoria' ),
          'new_item_name' =&gt; __( 'Nome da nova categoria' ),
          'menu_name' =&gt; __( 'Categoria' ),
          ),
          'show_ui' =&gt; true,
          'show_in_tag_cloud' =&gt; true,
          'query_var' =&gt; true,
          'rewrite' =&gt; array(
              'slug' =&gt; 'produtos/categorias',
              'with_front' =&gt; false,
          ),)
      );
      register_taxonomy_for_object_type( 'tags', 'produto' );
  }
  </code></pre>