WordPress

推荐列表 站点导航

当前位置:首页 > 建站教程 > WordPress >

WordPress调用指定分类下的文章

来源:网络整理  作者:  发布时间:2020-12-14 21:40
ul ?php $args=array( cat = 1, // 分类ID posts_per_page = 10, // 显示篇数 ); query_posts($args); if(have_posts()) : while (have_posts()) : the_pos...

        'cat' => 1,   // 分类ID

    if(have_posts()) : while (have_posts()) : the_post();

    <li>

                echo $description = get_the_excerpt(); //文章编辑中的摘要

            } ?>

        </span>

    $args=array(

    </li>

                echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……"); //文章编辑中若无摘要,自定截取文章内容字数做为摘要

        <?php if (has_excerpt()) {

        'posts_per_page' => 10, // 显示篇数

    );

?>

        <a href=http://www.ym97.com/wordpressjc/"<?php the_permalink(); ?>"><?php the_title(); ?></a> //标题

<?php  endwhile; endif; wp_reset_query(); ?>

            }else {

        <span>

    query_posts($args);

相关热词: 调用

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jz/wp/3917.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

WordPress调用指定分类下的文章

2020-12-14 编辑:

        'cat' => 1,   // 分类ID

    if(have_posts()) : while (have_posts()) : the_post();

    <li>

                echo $description = get_the_excerpt(); //文章编辑中的摘要

            } ?>

        </span>

    $args=array(

    </li>

                echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……"); //文章编辑中若无摘要,自定截取文章内容字数做为摘要

        <?php if (has_excerpt()) {

        'posts_per_page' => 10, // 显示篇数

    );

?>

        <a href=http://www.ym97.com/wordpressjc/"<?php the_permalink(); ?>"><?php the_title(); ?></a> //标题

<?php  endwhile; endif; wp_reset_query(); ?>

            }else {

        <span>

    query_posts($args);

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jz/wp/3917.shtml

相关文章

风云图片

推荐阅读

返回WordPress频道首页