wordpress代码

带侧边样sidebar的分类页面代码

 ====taxonomy-catedownload.php=============================

<?php 
            require TPLCURROOT.'tpl/sidebar_catedownload.php';
        ?>

                    <div class="col-lg-8 mt-1-9 order-1 order-lg-2">
                         <div class=" mb-4 wow fadeInUp" data-wow-delay="200ms">
                      


     <?php if( have_posts() ): ?>               
                        <?php while( have_posts() ): the_post(); ?>
                            <?php 

                          //  pre($post);
                             $title = $post->post_title;
                             $theid = $post->ID;
                              $dateday = substr($post->post_date,0,10);
                               $postexcerpt = $post->post_excerpt;
                              // echo $postexcerpt;
                               $postcnt = $post->post_content;
                               if($postexcerpt==''){
                                    $postcnt = strip_tags($postcnt);
                                    $num = 60;
                                    $postexcerpt = mb_substr($postcnt,0,$num,'UTF-8').'...';
                                 
                               }  

                             // $image = get_the_post_thumbnail_url( get_the_ID(), 'medium' );

                               $image = '';
                               if ( has_post_thumbnail() ) {
            
                                  $image = get_the_post_thumbnail( $post->ID, 'medium', array(
                                     // 'title' => $title_attribute,
                                     // 'alt'   => $img_alt,
                                       'alt'   => $title,
                                       'class' => 'w-100'
                                    ) ) ;
                              }

  //--------------
                     //$value = get_field( 'my_field', $post_id );
                   $vdownurl =  get_field('downurl',$theid);

               

            ?>

                        <div class="pricing-block border-radius-10  " style="padding: 5px;!important;margin-bottom: 10px;">
                            <div class="row align-items-center mt-n4">
                              

                                <div class="col-lg-10 mt-4" style="font-size: 20px;">
                                    <?php echo $title?>
                                </div>
                                <div class="col-lg-1 mt-4">
                                    <div class="icon text-xl-center">
                                        <a href="<?php echo $vdownurl?>" target="_blank"  class="bg-primary"><i class="fa-solid fa-file-pdf  text-secondary "></i></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                      

  <?php endwhile; ?> 
                <?php endif; ?>  
        
        
                            <?php 
                                    require_once get_template_directory ().'/tpl/pagelist.php'; 
                                ?>

                      

                    </div>

======================================

-----------sidebar_catedownload.php--------------

  <div class="col-lg-4 mt-1-9 order-2 order-lg-1">
                        <div class="service-sidebar me-xxl-1-9">
                            <div class="mb-2-9 widget  bg-light">
                     
                                <h5 class="display-6 font-weight-600 lh-1 pb-3 mb-3">Down <span class="text-primary font-weight-800">List</span></h5>
                                <ul class="cetegory p-0 list-unstyled mb-0">
                                <?php 
                                    $menuarr = wp_get_nested_menu_array(38);
                                    foreach ($menuarr as $key => $v) {
                                        
                                              $url = $v['url'];
                                              $name = $v['title'];
                                    
                                    ?>     
                                   <li class="mb-2"><a href="<?php echo $url;?>"><?php echo $name;?><i class="ti-angle-right"></i></a></li>
                                     
                                    <?php  } ?> 
                                   </ul>
                            </div>
    

                        </div>
                    </div>
             

=============pagelist.php================


<style type="text/css">
    .dmpageprevnext{padding:20px 0}
.dmpagination{text-align:center;padding:20px 0}
.dmpagination .page-numbers{text-decoration:none;line-height:1;margin-right:20px;background:#f4f5f7;border-radius:3px;padding:12px 15px;color:#272626;display:inline-block}
.dmpagination .current{background:#96eb64;color:#fff}

</style>
<div class="dmpagination">
    <?php echo paginate_links();?>
</div>

=====================