Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rapuolas

    (@rapuolas)

    Thanks for help, lock The post 😀

    Thread Starter rapuolas

    (@rapuolas)

    Thank you for your respond.

    I am trying to do as you said.
    For now i got taxonomies.
    Categories

    Found a code that should do the half of the job, but can not get the index, could you help me with this?

       add_action( 'wp_footer', 'getOrderID' );
    
       function getOrderID() {
    
          $custom_terms = get_terms('ait-items');
          foreach($custom_terms as $custom_term) {
           // var_dump($custom_term);
    
            wp_reset_query();
            $args = array('post_type' => 'ait-item',
              'tax_query' => array(
                array(
                   'taxonomy' => 'ait-items',
                   'field' => 'slug',
                   'terms' => $custom_term->slug,
                   ),
                ),
              );
    
            $loop = new WP_Query($args);
    
            if($loop->have_posts()) {
             echo '<h2>'.$custom_term->id.'</h2>';
    
             while($loop->have_posts()) : $loop->the_post();
             echo '<a href="'.get_permalink().'">'.get_the_title().'</a>';
             endwhile;
          }
       }
    
Viewing 2 replies - 1 through 2 (of 2 total)