效果预览
![图片[1]-子比主题-添加一个其它说明模块](https://img.lovelu.top/wordpress/post/2023/11/qitashuoming1.png)
内容主要包含
魔改说明
魔改比较简单,分为以下几个步骤:
- zibll根目录functions文件修改
- zibll>>pages添加页面
- 上传css文件,并替换地址
- 修改相关内容为你站点(相关图标、说明等)
- 后台添加页面,模板选择其它说明即可
functions修改
//其它说明
function top_comment_authors($amount = 4) {
global $wpdb;
$i=0;
$prepared_statement = $wpdb->prepare(
'SELECT *,COUNT(comment_author) AS comments_count, comment_author, comment_author_url
FROM '.$wpdb->comments.'
WHERE comment_author != "" AND comment_type = "comment" AND comment_approved = 1
GROUP BY comment_author
ORDER BY comments_count DESC, comment_author ASC
LIMIT %d',
$amount);
$results = $wpdb->get_results($prepared_statement);
$output = '<ul class="mod-list row"><h5 style="color: var(--main);margin-bottom:0;position: relative;font-weight: 600;">评论榜单</h5>';
$pllv = ''; // 定义$pllv并设置为空字符串
foreach($results as $key => $result) {
$i++;
$com_n = $result->comments_count;
if($result->user_id == 1){
$com_n += 94;
}
// 添加前15名标签
if($i <= 15){
$pllv = '<p class="aut-a infor'.($key+1).'">第'.($key+1).'名</p>';
}
$usertx = get_avatar($result->user_id, 32);
$output .= '
<li style="margin:0 15px;" class="li'.$i.'">
<div class="box box'.$i.'">
<a href="https://www.lovelu.top/author/'.$result->user_id.'" target="_blank" data-toggle="tooltip" data-original-title="访问用户网站">'.$usertx.'</a>
</div>
<div style="margin: 10px;">
<div class="username" title="" style="max-width: 84px;margin: auto;font-size: large;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<a href="https://www.lovelu.top/author/'.$result->user_id.'"><code>'.$result->comment_author.'</code></a>
</div>
<div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">评论'.$result->comments_count.'条</div>
'.$pllv.'
</div>
</li>';
}
$output .= '</ul>';
echo $output;
}
CSS文件
由于CSS文件较多,本站没有放在后台自定义CSS中,如果不想放的话,直接复制进去即可
.mod-list code:not([class]) {
font-weight: 600;
padding: 0 8px;
margin: 4px;
font-family: 'Joe Font';
font-size: 14px;
word-break: keep-all;
vertical-align: baseline;
background-color: white;
color: inherit;
margin: 2px;
}
.li1 {
width: 100% !important;
}
.icon1,
.icon2,
.icon3,
.icon4 {
font-size: 50px;
display: inline-block;
vertical-align: text-top !important;
font-weight: 400;
margin-top: -102px;
margin-right: -92px;
position: relative;
}
.box1 img {
box-shadow: 5px 5px 5px rgb(255 129 0/55%);
-webkit-box-shadow: 5px 5px 5px rgb(255 129 0/55%);
width: 166px;
border-radius: 20%;
border: 1px solid #ffbc78d6;
}
.box2 img {
box-shadow: 5px 5px 5px rgb(39 0 255/50%);
-webkit-box-shadow: 5px 5px 5px rgb(39 0 255/50%);
width: 166px;
border-radius: 20%;
border: 1px solid #9480ffe0;
}
.box3 img {
box-shadow: 5px 5px 5px rgb(251 0 255/50%);
-webkit-box-shadow: 5px 5px 5px rgb(251 0 255/50%);
width: 166px;
border-radius: 20%;
border: 1px solid #fd80ffcc;
}
.box4 img {
box-shadow: 5px 5px 5px rgb(251 255 0 / 50%);
-webkit-box-shadow: 5px 5px 5px rgb(251 255 0 / 50%);
width: 166px;
border-radius: 20%;
border: 1px solid #feff84;
}
.autlvt {
font-size: 20px;
color: #fff;
display: inline-block;
vertical-align: text-top;
font-weight: 400;
border-radius: 6px;
line-height: 1.4;
padding: 0 6px;
letter-spacing: 0px;
margin-top: -165px;
margin-left: -110px;
position: relative;
}
.mod-list {
justify-content: space-between;
padding-left: 0;
-webkit-justify-content: space-between;
display: flex;
margin-bottom: 20px !important;
margin: auto;
padding: 0;
text-align: center;
flex-wrap: wrap;
}
.mod-list li {
list-style: none;
box-sizing: border-box;
}
@media screen and (max-width: 768px) {
.box img {
width: 100px;
}
.autlvt {
margin-top: -140px;
margin-left: -82px;
font-size: 16px;
}
.icon1,
.icon2,
.icon3 {
margin-right: -70px;
}
}
.mod-list h5:before {
content: '「';
color: #f04494;
font-weight: 600;
margin-right: 5px;
}
.mod-list h5:after {
content: '」';
color: #f04494;
font-weight: 600;
margin-left: 5px;
}
.mod-list h5 {
font-size: 28px;
line-height: 32px;
padding: 20px 0 40px 0;
text-align: center;
width: 100%;
}
.joe_detail__article code:not([class]) {
background-color: white;
color: inherit;
margin: 2px
}
.joe_detail {
background: #fff;
border-radius: 12px;
padding: 20px;
}
.joe_detail__article table thead th {
text-align: center
}
.joe_detail__article p {
line-height: 36px;
margin: auto;
font-size: 14px;
text-align: center;
}
.aut-11 {
background: linear-gradient(317deg, #4d4c4c 30%, #878787 70%, #5f5c5c 100%);
}
.joe_detail {
padding: 0 30px 30px 30px;
}
.ds td {
text-align: center
}
.sevent1,
.sevent2 {
grid-template-columns: repeat(7, 1fr);
}
.layui-laypage>a:last-child,
.layui-laypage>a:last-child em {
margin-bottom: 5px !important;
}
/*博客重地 开始*/
.mod-list img {
box-shadow: 2px 3px 5px rgb(255 129 0 / 50%);
-webkit-box-shadow: 2px 3px 5px rgb(255 129 0 / 50%);
width: 166px;
border-radius: 20%;
border: 1px solid #ffbc78d6;
}
.box1 img {
box-shadow: 5px 5px 5px rgb(255 129 0/55%);
-webkit-box-shadow: 5px 5px 5px rgb(255 129 0/55%);
/* width: 125px; */
border-radius: 20%;
border: 1px solid #ffbc78d6;
}
.box2 img {
box-shadow: 5px 5px 5px rgb(39 0 255/50%);
-webkit-box-shadow: 5px 5px 5px rgb(39 0 255/50%);
/* width: 125px; */
border-radius: 20%;
border: 1px solid #9480ffe0;
}
.box3 img {
box-shadow: 5px 5px 5px rgb(251 0 255/50%);
-webkit-box-shadow: 5px 5px 5px rgb(251 0 255/50%);
/* width: 125px; */
border-radius: 20%;
border: 1px solid #fd80ffcc;
}
.box4 img {
box-shadow: 5px 5px 5px rgb(251 255 0 / 50%);
-webkit-box-shadow: 5px 5px 5px rgb(251 255 0 / 50%);
/* width: 125px; */
border-radius: 20%;
border: 1px solid #feff84;
}
.li1 {
width: 100% !important;
}
.joe_detail {
padding: 0 30px 30px 30px;
}
.aut-a {
background-image: -webkit-linear-gradient(0deg, #3a8ee6 0%, #93c8ff 100%);
font-size: 10px;
color: #fff;
display: inline-block;
vertical-align: text-top;
font-weight: 400;
border-radius: 2px;
line-height: 1.4;
padding: 0 4px;
margin-left: 5px;
letter-spacing: 0px;
}
.infor1 {
background-image: -webkit-linear-gradient(0deg, #e63a3a 0%, #ffb193 100%) !important;
}
.infor2 {
background-image: -webkit-linear-gradient(0deg, #efc85c 0%, #b8ff93 100%) !important;
}
.infor3 {
background-image: -webkit-linear-gradient(0deg, #c43ae6 0%, #9593ff 100%) !important;
}
.aut-a.infor1,
.aut-a.infor2,
.aut-a.infor3,
.aut-a.infor4,
.aut-a.infor5,
.aut-a.infor6,
.aut-a.infor7,
.aut-a.infor8,
.aut-a.infor9,
.aut-a.infor10,
.aut-a.infor11,
.aut-a.infor12,
.aut-a.infor13,
.aut-a.infor14,
.aut-a.infor15 {
padding: 0 10px;
font-size: 15px;
border-radius: 6px;
margin-top: -72px;
z-index: 1;
position: sticky;
}
.joe_dotted {
display: block;
width: 100%;
height: 2px;
background-size: 80px;
}
.joe_detail__article h5 {
font-size: 28px;
line-height: 32px;
padding: 20px 0;
text-align: center;
}
.joe_detail__article h5:after {
content: '」';
color: #f04494;
font-weight: 600;
margin-left: 5px;
}
.joe_detail__article h5:before {
content: '「';
color: #f04494;
font-weight: 600;
margin-right: 5px;
}
.joe_detail__article {
padding-top: 17px;
font-size: 17px;
word-break: break-all;
color: #606266;
}
#zm_gll {
color: #eee;
overflow: hidden;
margin: 10px 0;
padding: 15px 15px 15px 35px;
box-shadow: 6px 0 12px -5px #446e5c, -6px 0 12px -5px #ccd4a3;
background-image: linear-gradient(102deg, rgba(68, 110, 92, 1) 17.4%, rgba(107, 156, 120, 1) 49.3%, rgba(154, 183, 130, 1) 83.4%, rgba(247, 237, 191, 1) 110.3%);
}
#zm_mhz,
#zm_xgh,
#zm_tkzj,
#zm_yyz,
#zm_gll {
border-radius: 8px;
}
.joe_detail__article ol,
.joe_detail__article ul {
margin-bottom: 18px;
padding-left: 60px;
}
.joe_detail__article ol li {
list-style: decimal;
}
.joe_detail__article ol li {
color: #606266;
transition: .2s all;
}
.joe_detail__article ol li,
.joe_detail__article ul li {
line-height: 30px;
}
.joe_detail__article ol li::marker {
content: " # " counter(list-item) " ";
color: #f04494;
}
.joe_detail__article code:not([class]) {
border-radius: 4px;
padding: 0 8px;
margin: 4px;
font-family: 'Joe Font';
font-size: 14px;
word-break: keep-all;
border: 1px solid #8880ff;
vertical-align: baseline;
}
.joe_detail__article ol li:hover {
color: #ffa07a;
}
.joe_card__describe {
position: relative;
border: 1px dashed #dcdfe6;
line-height: 26px;
}
.joe_card__describe-title {
position: absolute;
top: 0;
left: 8px;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
background: #fff;
padding: 0 5px;
color: #303133;
font-weight: 500;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.joe_card__describe-content {
color: #606266;
padding: 18px 15px 15px;
}
.joe_gird {
display: grid;
}
.joe_callout {
padding: 12px;
border: 1px solid #e4e7ed;
border-left-width: 4px;
border-radius: 4px;
color: #606266;
line-height: 36px;
}
.joe_callout *:last-child {
margin-bottom: 0 !important;
}
.joe_detail__article p:before {
content: '';
margin-right: 6px;
}
.joe_detail__article h1,
.joe_detail__article h2,
.joe_detail__article h3,
.joe_detail__article h4,
.joe_detail__article h5,
.joe_detail__article h6 {
color: #303133;
margin-bottom: 18px;
position: relative;
font-weight: 600;
}
@media (max-width: 768px) {
html .joe_detail__article {
font-size: 14px;
}
}
.joe_detail__article table {
width: 100%;
max-width: 100%;
table-layout: fixed;
color: #909399;
margin-bottom: 18px;
border-top: 1px solid #ebeef5;
border-left: 1px solid #ebeef5;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
.joe_detail__article table td,
.joe_detail__article table th {
padding: 8px;
border-bottom: 1px solid #ebeef5;
border-right: 1px solid #ebeef5;
}
.joe_card__describe-content *:last-child {
margin-bottom: 0 !important;
}
/*博客重地 结束*/
@media (max-width:420px) {
.joe_detail {
padding: 20px
}
.joe_detail__article ol,
.joe_detail__article ul {
margin-bottom: 18px;
padding-left: 30px;
}
.sevent1,
.sevent2 {
grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width:760px) {
.joe_gird__item {
margin-right: 10px;
}
}
@media (max-width:680px) {
.wkf,
.joe_gird {
white-space: nowrap;
overflow-y: scroll;
}
}
@media (max-width:585px) {
.wkf {
display: -webkit-box;
}
}
添加pages
添加页面
后台添加页面,模板选择其它说明,然后配置到菜单中即可
感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
- 最新
- 最热
只看作者