最新活动:电脑PC端+手机端+微网站+自适应网页多模板选择-建站388元起价!!!
要源码
当前位置:主页 > 网站建设 > wordpress调用指定分类文章,搭建网站

wordpress调用指定分类文章,搭建网站

时间:2023-07-23 10:07:23 阅读: 文章分类: 网站建设 作者: IT网站员

导读:搭建网站搭建网站

  • <ul>    
  • <?php    
  •     $args=array(    
  •         'cat' => 1,   // 分类ID    
  •         织梦模板网站'posts_per_page' => 10, // 显示篇数    
  •     );    
  •     query_posts($args);    
  •     if(have_posts()) : while (have_posts()) : the_post();    
  • ?>    
  •     <li>    
  •         <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> //标题    
  •         <span>    
  •         <?php if (has_excerpt()) {    
  •                 echo $description = get_the_excerpt(); //文章编辑中的摘要    
  •             }else {&n织梦的模板bsp;   
  •                 echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……"); //文章编辑中若无摘要,自定截取文章内容字数做为摘要    
  •             } ?>    
  •         </span>    
  •     </li>    
  • <?php  endwhile; endif; wp_reset_query(); ?>    
  • </ul>  
  • 相关信息技术网站网站开发技术。

    关键词标签: WordPress 文章 div

声明: 本文由我的SEOUC技术文章主页发布于:2023-07-23 ,文章wordpress调用指定分类文章,搭建网站主要讲述文章,div,wordpress网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_34921.html

我的IDC 网站建设技术SEOUC.COM
专注网站建设,SEO优化,小程序设计制作搭建开发定制网站等,数千家网站定制开发案例,网站推广技术服务。
  • 5000+合作客服
  • 8年从业经验
  • 150+覆盖行业
  • 最新热门源码技术文章