7B2主题添加自定义表情包功能-支持最新B2主题

演示画面为本站评论区:

图片[1]-7B2主题添加自定义表情包功能-支持最新B2主题-星空 - 奇怪的银河系

第一步

function.php添加代码如下
[content_hide]

//评论表情
require get_stylesheet_directory()."/b2/emoji.php";

第二步

1.emoji文件夹下的表情文件请放在主题目录下任意目录,例如:b2child/Assets/emoji/
2.emoji文件夹打开,将里边的123目录文件全部丢到/wp-includes/images/smilies

第三步

b2/comment.php 文件修改
图片[2]-7B2主题添加自定义表情包功能-支持最新B2主题-星空 - 奇怪的银河系

<a class="comt-addsmilies" href="javascript:;">表情包</a>
<div class="comt-smilies tabPanel"><?php inlo_smilies() ?></div>

CSS放在style.css

/*评论表情CSS*/

/**tabs**/
 .bq-close {
    top: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
}
.tabPanel ul li:hover {
    background: #ea7279;
    color: #fff;
    height: 28px;
}
.comt-smilies a:hover {
    box-shadow: 0px 2px 5px #b5b5b5;
}
.tabPanel ul {
    background: #fff;
    display: flex;
    height: 30px;
    position: absolute;
    /* bottom:0; */
    width: 100%;
}
.tabPanel ul li {
    z-index: 5;
    float: left;
    font-size: 12px;
    height: 29px;
    line-height: 30px;
    width: 100%;
    text-align: center;
    /* border-radius:4px; */
    background: #fff
}
.tabPanel .hit {
    border-bottom: 1px solid #fff;
    cursor: pointer;
    color: #fff;
    /* text-shadow:0 1px 0 #fff; */
    background: #4faff8;
}
.pane {
    margin-left: 15px;
    margin-top: 10px;
    min-height: 100px;
    background-color: #fff;
    display: none;
    width: 100%;
}
.panes {
    z-index: 4;
    width: 347px;
    height: 224px;
    position: absolute;
    overflow: scroll;
    background: #fff;
    margin-top: 25px;
    overflow-x: hidden;
}
.wp-smiley {
    max-height:50px!important;
    width: 50px!important;
    height: 50px!important;
}
.comt-smilies img {
    width: 50px;
    height: 50px;
}
.comt-smilies a {
    list-style-type: none;
    background: #f7f7f7;
    /* padding:5px 10px; */
    border-radius: 5px;
    display: inline-block;
    font-size: 12px;
    line-height: 14px;
    margin: 0 16px 4px 0;
    cursor: pointer;
    -webkit-transition: .3s;
    transition: .3s;
}
.comt-smilies1 {
    box-shadow: 0px 2px 5px rgb(181 181 181 / 32%);
    border: 1px solid #b7b7b780;
    padding: 10px;
    background: #ffffff;
    z-index: 4;
    display: none;
    width: 350px;
    height: 230px;
    position: absolute;
    margin-top: -240px;
    overflow: scroll;
}
.comt-smilies {
    border-radius: 4px;
    height: 256px;
    box-shadow: 0px 2px 5px rgb(181 181 181 / 32%);
    border: 1px solid #b7b7b780;
    background: #fff;
    width: 350px;
    margin-top: -260px;
    z-index: 3;
    position: absolute;
    display: none;
    overflow: hidden;
}
.comt-addsmilies {
    margin-right: 20px;
    color: #888;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    padding: 2px 15px;
    height: 22px;
    box-sizing: border-box;
    z-index: 1;
    margin-top: 1px;
}
.mrxu-item-xu-w {
    background-position: center center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    background-color: rgba(51, 51, 51, .2);
    background-size: 50%;
    position: absolute;
    top: 0;
    z-index: 2;
    display: none;
}
.post-module-thumb:hover .mrxu-item-xu-w {
    display: block;
}
.tt-slider {
    height: 50px;
    overflow: hidden;
}
.tt-slider .swiper-wrapper {
    height: 50px;
    overflow: hidden;
}
@media screen and (max-width: 768px) {
    .comt-smilies {
        width: 316px;
    }
    .comt-smilies a {
        margin: 0 10px 4px 0;
    }
    .pane {
        margin-left: 12px;
    }
}
/*评论表情CSS*/

 

附件下载:

百度网盘

[/content_hide]

7B2主题添加自定义表情包功能-支持最新B2主题-星空 - 奇怪的银河系
7B2主题添加自定义表情包功能-支持最新B2主题
0积分
登录功能已关闭,暂时无法查看
免费资源
© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享
评论 共1条

    暂无评论内容