Title: Posts created with Types does not appear
Last modified: August 30, 2016

---

# Posts created with Types does not appear

 *  [oleav](https://wordpress.org/support/users/oleav/)
 * (@oleav)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/posts-created-with-types-does-not-appear/)
 * I have created posts with Custom Posts and the regular Posts by WordPress. However,
   the custom posts does not appear on the website. Only the regular posts appears.
 * Here I have created Custom Posts:
    [http://i.stack.imgur.com/lZFnP.png](http://i.stack.imgur.com/lZFnP.png)
 * Here I have created posts with the regular WordPress posting:
    [http://i.stack.imgur.com/oXTvu.png](http://i.stack.imgur.com/oXTvu.png)
 * Here are the 2 latest posts within the category 9 (Featured) supposed to be shown:
   
   [http://i.stack.imgur.com/iMTlx.png](http://i.stack.imgur.com/iMTlx.png)
 * As you see, it does not show the one made with Custom Post. This is not the only
   example, but this is the easiest one to explain.
 *     ```
       <div class="col-md-12 myeluft">
                   <?php
                       $catquery = new WP_Query( 'cat=9&posts_per_page=2' );
                       while($catquery->have_posts()) : $catquery->the_post();
                   ?>
                   <div class="featured-post">
                       <ul>
                           <li>
                               <div class="col-md-5 featuredimage myeluftned">
                                   <?php the_post_thumbnail( 'singlepost-thumb' ); ?>
                               </div>
                               <div class="col-md-7 myeluftned">
                                   <h2 class="nomargintop blacklink">
                                       <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
                                   </h2>
                                   <div class="light offblack">
                                       <?php the_content(); ?>
                                   </div>
                                   <a href="<?php the_permalink() ?>" rel="bookmark">
                                       <button class="btn thin luft" type="button">Se prosjekt</button>
                                   </a>
                               </div>
                           </li>
                       </ul>
                   </div>
                   <div class="col-md-12">
                       <hr class="myeluft clearboth">
                       <?php endwhile; ?>
                   </div></div>
       ```
   
 * Anyone?
 * I will post detailed if you want, I just need to know what you want to know.
 * Is there a function I need to make Custom Fields Post to work?
 * Plugin used: Types
 * I have created posts with Custom Posts and the regular Posts by WordPress. However,
   the custom posts does not appear on the website. Only the regular posts appears.
 * Here I have created Custom Posts: Custom Posts
 * Here I have created posts with the regular WordPress posting: WordPress Posts
 * Here are the 2 latest posts within the category 9 (Featured) supposed to be shown:
   2 latest posts within the category 9
 * As you see, it does not show the one made with Custom Post. This is not the only
   example, but this is the easiest one to explain.
 * Code
 *  <div class=”col-md-12 myeluft”>
    <?php $catquery = new WP_Query( ‘cat=9&posts_per_page
   =2’ ); while($catquery->have_posts()) : $catquery->the_post(); ?> <div class=”
   featured-post”>
    -  <div class=”col-md-5 featuredimage myeluftned”>
       <?php the_post_thumbnail(‘
      singlepost-thumb’ ); ?> </div> <div class=”col-md-7 myeluftned”> <h2 class
      =”nomargintop blacklink”> ” rel=”bookmark”><?php the_title(); ?> </h2> <div
      class=”light offblack”> <?php the_content(); ?> </div> ” rel=”bookmark”> <
      button class=”btn thin luft” type=”button”>Se prosjekt</button>  </div>
 *  </div>
    <div class=”col-md-12″> <hr class=”myeluft clearboth”> <?php endwhile;?
   > </div></div> Anyone?
 * I will post detailed if you want, I just need to know what you want to know.
 * Is there a function I need to make Custom Fields Post / Types to work?
 * **Suggestions:**
    - Functions.php, something is wrong here
    - Types, something is wrong the setup
 * **Question also asked here: **[http://wordpress.stackexchange.com/questions/193188/posts-with-custom-fields-does-not-appear](http://wordpress.stackexchange.com/questions/193188/posts-with-custom-fields-does-not-appear)
 * [https://wordpress.org/plugins/types/](https://wordpress.org/plugins/types/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [iworks (Marcin Pietrzak)](https://wordpress.org/support/users/iworks/)
 * (@iworks)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/posts-created-with-types-does-not-appear/#post-6289317)
 * Dear oleav
 * When you using custom WP_Query like this:
 *     ```
       new WP_Query( 'cat=9&posts_per_page=2' );
       ```
   
 * Yo use default value for “post_type” witch is ‘post’.
 * see more: [http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters)
 * You should use (I prefer array not query string):
 *     ```
       $args = array(
           'cat' => 9,
           'posts_per_page' => 2,
           'post_type' => 'any',
       );
       new WP_Query($args);
       ```
   
 * But remember, that `any` retrieves any type except revisions and types with ‘
   exclude_from_search’ set to true.
 * or:
 *     ```
       $args = array(
           'cat' => 9,
           'posts_per_page' => 2,
           'post_type' => array(
               'post',
               '<custom-post-name>',
           ),
       );
       new WP_Query($args);
       ```
   
 * Cheers,
    Marcin
 *  Thread Starter [oleav](https://wordpress.org/support/users/oleav/)
 * (@oleav)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/posts-created-with-types-does-not-appear/#post-6289333)
 * Thank you. That solved the problem 🙂
 * Just another question, how would you have edited this so this showed all post
   types:
 *     ```
       <?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 ?>
       <?php if ( $the_query->have_posts() ) : ?>
           <div id="isotope-list">
           <?php while ( $the_query->have_posts() ) : $the_query->the_post();
           $termsArray = get_the_terms( $post->ID, "category" );  //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->slug.' '; //create a string that has all the slugs
               }
           ?>
           <div class="<?php echo $termsString; ?> item col-md-3"> <?php // 'item' is used as an identifier (see Setp 5, line 6) ?>
               <h3><?php the_title(); ?></h3>
                   <?php if ( has_post_thumbnail() ) {
                             the_post_thumbnail();
                       } ?>
           </div> <!-- end item -->
           <?php endwhile;  ?>
           </div> <!-- end isotope-list -->
       <?php endif; ?>
       ```
   
 * I have tried inserting an array, but it didnt work:
 *     ```
       $anyposttype = array('post_type' => 'any');
       $termsArray = get_the_terms( $post->ID, "category", $anyposttype);  //Get the terms for this particular item
       ```
   
 *  [iworks (Marcin Pietrzak)](https://wordpress.org/support/users/iworks/)
 * (@iworks)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/posts-created-with-types-does-not-appear/#post-6289413)
 * Dear oleav
 * See documentation:
    [https://codex.wordpress.org/Function_Reference/get_the_terms](https://codex.wordpress.org/Function_Reference/get_the_terms)
 * > Retrieve the terms of the taxonomy that are attached to the post.
 * This function get taxonomies assign to current post in loop.
 * M

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Posts created with Types does not appear’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * 3 replies
 * 2 participants
 * Last reply from: [iworks (Marcin Pietrzak)](https://wordpress.org/support/users/iworks/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/posts-created-with-types-does-not-appear/#post-6289413)
 * Status: not resolved