调用文章标题:<?php echo the_title(); ?>
调用时间,格式(2020,05,16):<?php echo get_the_date( 'Y,m,d' ); ?>
调用精准地址:<?php bloginfo('template_url');?> //后面可以加任意有效链接
调用文章内容:<?php echo the_content();?>
调用文章摘要:<?php if (has_excerpt()) {
echo $description = get_the_excerpt(); //文章编辑中的摘要
}else {
echo mb_strimwidth(strip_tags(apply_filters(‘the_content’, $post->post_content)), 0, 220,"……"); //文章编辑中若无摘要,自定截取文章内容字数做为摘要
} ?>
wordpress常用函数【可用】
最新推荐文章于 2024-05-28 19:24:15 发布