wordpress调用指定文章分类,不显示指定分类方法

<!--全部-->
<div class="feed-hot-item  J_hot_slick active">
<?php
  $args=array(
    'cat' => 225,   // 分类ID
    'category__not_in'   => array(7969),//不显示指定分类
    'posts_per_page' => 20, // 显示篇数
  );
  query_posts($args);
  if(have_posts()) : while (have_posts()) : the_post();
?>
<div class="feed-hot-window">
  <div class="feed-hot-list z-clearfix">
    <div class="feed-hot-card">
      <a href="<?php the_permalink(); ?>" target="_blank" title="<?php the_title(); ?>">
        <div class="feed-hot-pic">
          <img src="<?php echo mmimg(get_the_ID()); ?>" alt="<?php the_title(); ?>"  width="154px" height="154px" style="margin-top:0px" >
    </div>
    <div class="feed-hot-title"><?php the_title(); ?></div>
    <span class="z-highlight"><?php $key="redtitle"; echo get_post_meta($post->ID, $key, true); ?></span> 
      </a> 
    </div>
  </div>
</div>
  
<?php  endwhile; endif; wp_reset_query(); ?>

 

赞(0) 打赏

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址