I write simple wordpress loop for taxonomy.php file but don’t show result

Question

I created a custom post type and create for CPT a taxonomy. but when I click on show taxonomy link don’t work archive loop. I created taxonomy.php file for show this taxonomy in this file but display else result : “Sorry, no posts matched your criteria.


  <?php
//this is register taxonomy code : 

  function airdrop_taxonomy(){
   $tax_labels2=array(
       'name'=>__('دسته بندی ایردراپ ها'),
       'singular_name'=>__('دسته ایردراپ'),
       'all_items'=>__('همه ی دسته ها ایردراپ'),
   );
   $args_airdrop_taxonomy=array(
       'hierarchical'=>true,
       'labels'=>$tax_labels2,
       'public'=>true,
       'query_var'=>true
   );
   register_taxonomy('airdrop_taxonomy' , 'myairdrop',$args_airdrop_taxonomy);
}
?>
//this is my loop in taxonomy.php file :
      
        <table class="table">
                <thead class="thead-dark">
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">عنوان</th>
                    <th scope="col">هدف</th>
                    <th scope="col">تاریخ شروع</th>
                    <th scope="col">تاریخ پایان</th>
                    <th scope="col">لینک </th>
                </tr>
                </thead>
                <tbody>

                <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <tr>
                        <th scope="row">1</th>
                        <td></td>
                        <td>Otto</td>
                        <td>@mdo</td>
                        <td>@mdo</td>
                        <td>@mdo</td>
                    </tr>
                <?php endwhile; else: ?>
                    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
                <?php endif; ?>
                </tbody>
            </table>

0
Khaled Shokoohi 3 weeks 2021-09-02T05:03:11-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse