Thursday, December 15, 2022
HomeWordPress DevelopmentShow posts from particular slug of the customized taxonomy in Wordpress

Show posts from particular slug of the customized taxonomy in WordPress


I’ve this piece of code, however what I actually wish to do is to get all put up displayed from my taxonomy. The place do I place my taxonomy slug to verify solely a sure class posts are displayed? The class slug it is to illustrate “tasks”. How one can filter this class? Presently it appears that evidently it shows all my posts on the web page. Right here is the code:

  $myterms = get_terms('items', 'orderby=none&hide_empty');    
  echo  $myterms[0]->title;


  foreach ($myterms as $time period) :

    $args = array(
        'tax_query' => array(
            array(
                $term->slug,
            )
        )
    );
    
    //  assigning variables to the loop
    world $wp_query;
    $wp_query = new WP_Query($args);
    
    // beginning loop
    whereas ($wp_query->have_posts()) : $wp_query->the_post();
    
    the_title();

    
    endwhile;
    
    endforeach;

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments