说实话这个样式我还是不满意的,无奈忙里偷闲,将就一下吧,小伙伴们
教程
打开begin知更鸟主题更目录找到functions.php打开添加以下代码,只要你位置没添加错,报错不存在的
- //最新评论排第一
- function jiub($af){
- global $wpdb;
- $queryaf=“select comment_author, comment_author_url, comment_date from $wpdb->comments where comment_ID in (select max(comment_ID) from $wpdb->comments where comment_approved=’1′ and comment_author_url !=” and user_id=’0′ GROUP BY comment_author_email) ORDER BY comment_date DESC LIMIT $af”;
- $wally = $wpdb->get_results($queryaf);
- foreach ($wally as $commentaf){
- $tmpy= “<li><i class=\”fa fa-spinner fa-pulse\”></i><a target=\”_blank\” href=\””.$commentaf->comment_author_url.“\”>”.$commentaf->comment_author.“</a></li>”;
- $outputy .= $tmpy;
- }
- $outputy = “<ul>”.$outputy.“</ul>”;
- echo $outputy ;
- }
打开更目录cms文件夹,找到cms-news.php打开并在以下截图红色标记的位置上面添加以下代码
- <!– 最新文章 –>
- <style>
- .jiub{width:100%;margin–bottom:10px;height:auto!important;background:#fff;border:1px solid #f5f9ff;text-align:center;color:#096cb2;
- border:1px solid #eaeaea;border-radius:4px;}
- .jiub p{padding–top:4px;font–size:17px;}
- .jiub ul{margin–top:10px;margin–bottom:10px;font–size:13px;padding–bottom:40px;margin–left: 36px;}
- .jiub ul li{list–style:none;float:left;margin–left:0px;margin–bottom:10px;width:16.6%;overflow:hidden;height:23px;text–align:left;}
- .jiub ul li img{width:20px;height:20px;margin–left:2px;margin–right:2px;}
- /*@media (max-width:820px) {.vistor{display:none}}*/
- @media (max–width:820px) {
- .jiub ul li{width:25%;font–size:9px;}
- .jiub p{padding–top:4px;font–size:15px;}
- }
- .jiub i{
- color:#000000;
- margin–right:6px;
- }
- </style>
- <div class=“jiub”>
- <p>新评论将会排列第一</p>
- <?php jiub(24); ?>
- <div style=“clear: both;display:block“> </div>
- </div>
打开header.php在中间添加以下css外链,外链是我网站的链接,你自己也可以本地化
- <link rel=“external nofollow” target=“_blank” href=“https://jiub.ren/wp-content/themes/begin/go.php?url=aHR0cDovL2ppdWIucmVuL3dwLWNvbnRlbnQvdGhlbWVzL2JlZ2luL2Nzcy9mb250LWF3ZXNvbWUuY3Nz” rel=“stylesheet”>
© 版权声明
THE END
暂无评论内容