title: Get_the_terms - display all post types
body: <p><strong>The question has been updated. See below for latest version</strong></p>
  
  <p>I am having troubles to see all post types when using custom posts. This is based on isotope, and the user is supposed to click on the links to see posts within that category.</p>
  
  <p>All posts created by Wordpress standard posts appears, but none created with Types (Custom posts).</p>
  
  <pre><code>&lt;ul id="filters" class="whitetext whitelink myeluft"&gt;
      &lt;li&gt;&lt;a href="#" data-filter="*" class="selected"&gt;Alle&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href='#' data-filter='.foto'&gt;Foto&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href='#' data-filter='.video'&gt;Video&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href='#' data-filter='.web'&gt;Web&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;?php $the_query = new WP_Query( 'posts_per_page=50' ); //Check the WP_Query docs to see how you can limit which posts to display ?&gt;
  &lt;?php if ( $the_query-&gt;have_posts() ) : ?&gt;
      &lt;div id="isotope-list"&gt;
          &lt;?php while ( $the_query-&gt;have_posts() ) : $the_query-&gt;the_post(); 
  
  
          // Query posts - post_types
          $anypost = get_posts( array(
               'post_type'      =&gt; 'any' // every post type, but not attachments
          ) );
  
          $termsArray = get_the_terms( $post-&gt;ID, "category", $anypost);  //Get the terms for this particular item
          $termsString = ""; //initialize the string that will contain the terms
              foreach ( $termsArray as $term ) { // for each term 
                  $termsString .= $term-&gt;slug.' '; //create a string that has all the slugs 
              }
          ?&gt; 
          &lt;div class="&lt;?php echo $termsString; ?&gt; item col-md-3"&gt; &lt;?php // 'item' is used as an identifier (see Setp 5, line 6) ?&gt;
              &lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
                  &lt;?php if ( has_post_thumbnail() ) { 
                            the_post_thumbnail();
                      } ?&gt;
          &lt;/div&gt; &lt;!-- end item --&gt;
          &lt;?php endwhile;  ?&gt;
      &lt;/div&gt; &lt;!-- end isotope-list --&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>As you see, I have tried fixing it by inserting the following code, but it still doesn't show all post types.</p>
  
  <pre><code>// Query posts - post_types
  $anypost = get_posts( array(
      'post_type'      =&gt; 'any' // every post type, but not attachments
  ) );
  
  $termsArray = get_the_terms( $post-&gt;ID, "category", $anypost);  //Get the terms for this particular item
  </code></pre>
  
  <p>I have read <a href="https://codex.wordpress.org/Function_Reference/get_the_terms">this article</a>, but I found my self more loss than started/</p>
  
  <p>What would be a working solution?</p>
  
  <p><strong>Update</strong></p>
  
  <p>By using the following code I am able to see all posts, but not being able to filter them out. See page here: <a href="http://goo.gl/e3cLuM">http://goo.gl/e3cLuM</a> (scroll down till you see all the posts)</p>
  
  <pre><code>&lt;?php $post_type = 'any';
  $post_taxonomy = 'any';
  // Get all
  $terms = get_terms( $post_taxonomy );
  
  $portfolio = new WP_Query('post_type='.$post_type.'&amp;post_per_page=-1'); ?&gt;
  // First we loop our porfolio_category to show all categories as filter.
  &lt;ul id="filters" class="whitetext whitelink myeluft"&gt;
      &lt;a href="#" data-filter="*" class="selected"&gt;&lt;li class="smoothtrans"&gt;Alle&lt;/li&gt;&lt;/a&gt;
      &lt;a href='#' data-filter='.foto'&gt;&lt;li class="smoothtrans"&gt;Foto&lt;/li&gt;&lt;/a&gt;
      &lt;a href='#' data-filter='.video'&gt;&lt;li class="smoothtrans"&gt;Video&lt;/li&gt;&lt;/a&gt;
      &lt;a href='#' data-filter='.web'&gt;&lt;li class="smoothtrans"&gt;Web&lt;/li&gt;&lt;/a&gt;
  &lt;/ul&gt;
  
  &lt;?php if ( $portfolio-&gt;have_posts() ) : ?&gt;
                  &lt;div id="isotope-list"&gt;
                      &lt;?php while ( $portfolio-&gt;have_posts() ) : $portfolio-&gt;the_post();
  // Get current post terms.
                          $item_terms = wp_get_post_terms( get_the_ID(), $post_taxonomy, $args );
                          $classes = '';
                          // Append classes to use with each item.
                          foreach($item_terms as $item_term ){
                              $classes .= $item_term-&gt;slug.' ';
                          }
                          ?&gt;
                          &lt;div class="&lt;?php echo $termsString; ?&gt; item col-md-4"&gt; 
                              &lt;ul class="grid cs-style-3"&gt;
                                  &lt;li&gt;
                                      &lt;figure&gt;
                                          &lt;?php // 'item' is used as an identifier (see Setp 5, line 6) ?&gt;
                                          &lt;?php if ( has_post_thumbnail() ) { 
                                                the_post_thumbnail();
                                          } ?&gt;
                                          &lt;figcaption class="lefttext"&gt;
                                              &lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
                                              &lt;span class="offgrey"&gt;Nettside&lt;/span&gt;
                                              &lt;a href="#" class="smoothtrans"&gt;Se prosjekt&lt;/a&gt;
                                          &lt;/figcaption&gt;
                                      &lt;/figure&gt;
                                  &lt;/li&gt;
                              &lt;/ul&gt;             
                          &lt;/div&gt; &lt;!-- end item --&gt;
                      &lt;?php endwhile;  ?&gt;
                  &lt;/div&gt; &lt;!-- end isotope-list --&gt;
              &lt;?php endif; ?&gt;
  </code></pre>