记录日常点点滴滴,欢迎来到我的小站。

0%

1、要是关闭某一篇文章的评论,在发表文章的时候,在下面有个“讨论”,把”允许评论”去掉勾选就可以了。

2、要是关闭所有文章的评论,在“设置”-“讨论设置”把“默认文章设置”中的“允许访客对新文章发表评论 ”不再勾选就可以啦
3、直接在CSS中添加display:none; 最快捷。

1
2
3
4
5
6
7
if( have_posts() ) {
while( have_posts() ) {
the_post();
$category = get_the_category(); //获取category
$parents = $category[0]->category_parent; //获得category 下的parent数据库内容
$type = $category[0]->term_id; //获取分类ID
$parent = get_cat_name($category[0]->category_parent); //显示相应parent的category的名称

通过获得数据库的这些内容,可以更好的对样式进行操作

1
<?php echo mb_substr(get_the_excerpt(),0,55,"utf8").'"<a href="'. get_permalink($post-&gt;ID) . '"> 阅读全文...</a>"'?>

其中55是设置的文字长度。