title: Wordpress display custom posts based on category_name
body: <p>I'm trying to create a thumbnail approach with products from a custom post type (lawnmowers, actually) based on the category written in an input field using ACF.</p>
  
  <p>However, I'm currently unable to present any posts at all even when hardcoding my category. </p>
  
  <pre><code>$loop = new WP_Query( array( 'category_name' =&gt; 'frontmower', 'posts_per_page' =&gt; 10 ) ); 
  </code></pre>
  
  <p>Lawnmowers is a subcategory found 2 steps under "Products" &amp; "Machines".</p>
  
  <pre><code>&lt;div class="thumbContainer"&gt;
  &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); ?&gt;
          &lt;?php echo '&lt;a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark"&gt;'; ?&gt;
      &lt;div class="productThumbnail"&gt;
          &lt;img src="&lt;?php the_field( "productImage" ); ?&gt;" alt="image"/&gt;
          &lt;?php the_title( '&lt;h2 class="entry-title"&gt;', '&lt;/h2&gt;' ); ?&gt;
  
              &lt;div class="entry-content"&gt;
                  &lt;?php the_content(); ?&gt;
              &lt;/div&gt;
      &lt;/div&gt;
      &lt;?php echo '&lt;/a&gt;'; ?&gt;
  &lt;?php endwhile; ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>For whatever reason I cannot understand why it isn't working. Trying different echo's to find out if my script enter the while-loop, but it doesn't!</p>
  
  <p>However, <strong>this</strong> works just fine:</p>
  
  <pre><code>$loop = new WP_Query( array( 'post_type' =&gt; 'ridinglawnmowers', 'posts_per_page' =&gt; 10 ) ); 
  </code></pre>
  
  <p>But I cannot use post_type, as I would need to create zillions different post types. Having them all count as lawnmowers and presenting them with categories is the way to go.</p>