WordPress 网站添加悬浮邮箱按钮图标

//添加悬浮邮箱
function add_float_email() {
    echo '<div class="right-email"><a href="mailto:cocostudioshop@gmail.com" target="_blank" title="Send us an email"><i class="icon-envelop"></i>Email</a></div>'; 
}
add_action('wp_footer', 'add_float_email');

Style.css 新增

/* 悬浮邮箱*/
.right-email {
    position: fixed;
    text-align: center;
    width: 100px;
    height: 40px;
    right: 0;
    margin-right:-57px;
    z-index: 9999;
    bottom: 50%;
    background: #000;
    border-radius: 20px 0 0 20px;
    line-height: 40px;
    transition:.25s;

}
.right-email:hover{
        margin-right:0;
      background:var(--fs-color-primary)
}
.right-email i{
    margin-right:10px;
}
.right-email a{
        color:#fff
}