title: Calling wordpress post by custom taxonomy
body: <p>I defined a custom taxonomy in WordPress as below:</p>
  
  <pre><code>function content_selector() {
    register_taxonomy(
        'contentselector',
        'post',
        array(
                'label' =&gt; __( 'Content Selector' ),
                'rewrite' =&gt; array( 'slug' =&gt; 'cs' ),
                'hierarchical' =&gt; true,
        )
    );
  }
  add_action( 'init' , 'content_selector' );
  </code></pre>
  
  <p>It shows up in new posts and values can be assigned, actually it seems working. But when I use following function for calling posts by this taxonomy, there is no success.</p>
  
  <pre><code>add_shortcode('rps', 'rpsf');
  function rpsf() {
       $args =[ 'posts_per_page' =&gt; 1, array(
  
               'tax_query' =&gt; array(
                              array(
                                   'taxonomy' =&gt; 'contentselector',
                                   'field' =&gt; 'slug',
                                   'terms' =&gt; 'one-of-the-assigned-terms')
            ))];
  
    $query = new WP_Query( $args );
  
       if ( $query-&gt;have_posts() ) : while ( $query-&gt;have_posts() ) : $query-&gt;the_post();
            ob_start();  ?&gt;
  
                &lt;div class="rpst"&gt;
                &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;span&gt;&lt;?php the_title(); ?&gt;&lt;/span&lt;/a&gt;
                &lt;/div&gt;
  
        &lt;?php endwhile; endif; wp_reset_postdata();
     return ob_get_clean();
  }
  </code></pre>
  
  <p>Did I make a mistake in defining taxonomy or in calling posts? </p>