Categories
WordPress 知识

WordPress 判断文章的类型

<?php
//如果是视频则不显示时间、字数、评论数、以及the_excerpt,并调整高度为300px
if(get_post_type() == “works”) : ?>

<?php
//下面的是文章,全部正常显示
else :?>
<?php endif;?>

Leave a Reply

Your email address will not be published. Required fields are marked *