使用标题判断对应的点击广告显示:制造热门人数咨询

38 次浏览次阅读
没有评论

功能:

在第一张图片下面显示点击按钮和多人咨询,并增加相应的关键词随机显示。

显示效果:

使用标题判断对应的点击广告显示:制造热门人数咨询

代码:

HTML
<!-- 留咨按钮 -->
<style>
.custom-btn-wrap {
    text-align: center;
    margin: 30px 0;
}

/* 顶部咨询状态 */
.consult-status {
    display: inline-flex;
    align-items: center;
    font-size: 18px;
    color: #FFB400;
    margin-bottom: 20px;
    font-weight: bold;
    width: 100%;                 /* 独占一行 */
    justify-content: center;     /* 居中显示 */
}

.consult-status .dot {
    width: 14px;
    height: 14px;
    background: #0AC253;
    border-radius: 50%;
    margin-right: 8px;
}

/* 按钮样式 */
.custom-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    background: #2E7FFF;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    position: relative;
    transition: 0.2s;
}

.custom-button:hover {
    opacity: 0.9;
}

/* 二维码弹层 */
.qrcode-box {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -170px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
}

.qrcode-box img {
    width: 150px;
    height: 150px;
}

.qr-btn:hover .qrcode-box {
    display: block;
}
</style>
<!-- 留咨按钮 end-->

 <!-- 留咨按钮 -->
<div id="liuzi_anniu" class="custom-btn-wrap" style="display: none;">

    <!-- 顶部咨询状态:独立一行 -->
    <div class="consult-status">
        <span class="dot"></span>
        4人正在咨询
    </div>

    <a  target="_blank" onclick="open_suxiao();" class="custom-button">
        在线咨询
    </a>

    <a href="javascript:void(0);" class="custom-button qr-btn">
        添加客服微信
        <div class="qrcode-box">
            <img src="https://cdnpic.xxx.com/uploads/20240924/e39236eb0de6360e9a9e7b4135532673.png" alt="微信二维码" img-loaded="true">
        </div>
    </a>

</div>


<h1 class="entry-title">AI智能客服机器人:AI训练场助力企业提升客户服务效率 LLM客服</h1>
<div class="entry-content">
    <p>在当今数字化时代,企业越来越依赖智能客服机器人来提升客户服务效率。AI训练场作为领先的人工智能平台,为企业提供了强大的工具和资源,帮助他们构建和优化智能客服解决方案。</p>
    <p>智能客服机器人能够自动处理大量客户查询,提供即时响应,减少
人工客服的工作负担。通过AI训练场,企业可以轻松训练和部署定制化的智能客服机器人,满足不同业务需求。</p>
<img src="http://insight.xxx.com/wp-content/uploads/2025/12/263-e1764578522916.jpg" alt="智能客服机器人">
    <p>AI训练场提供了丰富的训练数据和先进的机器学习算法,使企业能够不断提升智能客服机
        <img src="http://insight.xxx.com/wp-content/uploads/2025/12/263-e1764578522916.jpg" alt="智能客服机器人">器人的性能和准确性。此外,平台还支持多语言和多渠道的客户服务,确保企业能够覆盖更广泛的客户群体。</p>
</div>

<script>
document.addEventListener("DOMContentLoaded", () => {
    const titleEl = document.querySelector("h1.entry-title");
    const keywords = ["AI智能客服", "机器人", "AI训练场","LLM客服","智能客服机器人","智能客服","AI客服"];
    const liuziBtn = document.getElementById("liuzi_anniu");

    if (!titleEl || !liuziBtn) return;

    const titleText = titleEl.textContent;

    // 判断标题是否包含任意关键词
    const matched = keywords.some(keyword => titleText.includes(keyword));

    if (matched) {
        // 获取 entry-content 下的第一张图片
        const entryContent = document.querySelector(".entry-content");
        if (entryContent) {
            const firstImg = entryContent.querySelector("img");
            if (firstImg) {
                // 将原按钮div移动到图片下面
                firstImg.insertAdjacentElement('afterend', liuziBtn);
                liuziBtn.style.display = "block";

                // 生成 1~9 的随机数
                const randomNum = Math.floor(Math.random() * 8) + 1;
                // 替换“4人正在咨询”中的数字
                const statusEl = liuziBtn.querySelector(".consult-status");
                if (statusEl) {
                    statusEl.innerHTML = `<span class="dot"></span>${randomNum}人正在咨询${keywords[Math.floor(Math.random() * keywords.length)]}`;
                }
            }
        }
    } else {
        // 如果标题不匹配,则隐藏按钮
        liuziBtn.style.display = "none";
    }
});
</script>
<!-- 留咨按钮 end-->

对付wordpress懒加载的图片解决方案:

HTML

<!--自定义按钮 毛毛-->
<!-- 留咨按钮 -->
<style>
.custom-btn-wrap {
    text-align: center;
    margin: 30px 0;
}

/* 顶部咨询状态 */
.consult-status {
    display: inline-flex;
    align-items: center;
    font-size: 18px;
    color: #FFB400;
    margin-bottom: 20px;
    font-weight: bold;
    width: 100%;                 /* 独占一行 */
    justify-content: center;     /* 居中显示 */
}

.consult-status .dot {
    width: 14px;
    height: 14px;
    background: #0AC253;
    border-radius: 50%;
    margin-right: 8px;
}

/* 按钮样式 */
.custom-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    background: #2E7FFF;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    position: relative;
    transition: 0.2s;
}

.custom-button:hover {
    opacity: 0.9;
}

/* 二维码弹层 */
.qrcode-box {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -170px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
}

.qrcode-box img {
    width: 150px;
    height: 150px;
}

.qr-btn:hover .qrcode-box {
    display: block;
}
</style>
<!-- 留咨按钮 end-->
 <!-- 留咨按钮 -->
<div id="liuzi_anniu" class="custom-btn-wrap" style="display: none;">
    <!-- 顶部咨询状态:独立一行 -->
    <div class="consult-status">
        <span class="dot"></span>
        4人正在咨询
    </div>
    <a href="javascript:void(0);" onclick="open_suxiao();" class="custom-button" style="color:#F6F7F9">在线咨询</a>
    <a href="javascript:void(0);" class="custom-button qr-btn" style="color:#F6F7F9">添加客服微信
        <div class="qrcode-box">
            <img src="https://cdnpic.xxx.com/uploads/20251209/3ccdb5abf36c1568028f4e5d651b88bf.jpeg" style="max-width:none;" alt="微信二维码" img-loaded="true">
        </div>
    </a>
</div>
<script>
document.addEventListener("DOMContentLoaded", () => {
    const titleEl = document.querySelector("h1.entry-title");
    const keywords = [
        "客服AI-Agent","客服系统","智能客服系统","智能客服","AI-Agent","LLM智能助理",
        "AI客服","智能客服机器人","客服机器人","客服AI","AI客服系统","智能助手",
        "语音客服","聊天机器人","LLM客服","AI客服助理","智能客服平台","智能客服Agent",
        "AI训练场","客服培训","客服技能训练","智能客服训练","AI客服训练",
        "聚合接待","语流机器人","语流Agent","客服外包","AIBPIO","BPO","LLM"
    ];
    const liuziBtn = document.getElementById("liuzi_anniu");

    if (!titleEl || !liuziBtn) return;

    const titleText = titleEl.textContent;

    // 找出所有匹配的关键词
    const matchedKeywords = keywords.filter(kw => titleText.includes(kw));

    if (matchedKeywords.length === 0) {
        liuziBtn.style.display = "none";
        return;
    }

    // 找 entry-content 下的第一个 wp-block-image
    const firstImageBlock = document.querySelector(".entry-content .wp-block-image");

    if (firstImageBlock) {
        // 随机人数 1~9
        const num = Math.floor(Math.random() * 9) + 1;

        // 随机选择一个匹配的关键词
        const matchedKeyword = matchedKeywords[Math.floor(Math.random() * matchedKeywords.length)];

        const statusEl = liuziBtn.querySelector(".consult-status");
        if (statusEl) {
            statusEl.innerHTML = `<span class="dot"></span>${num}人正在咨询“${matchedKeyword}”相关解决方案`;
        }

        // 插入按钮到 wp-block-image 后面
        firstImageBlock.insertAdjacentElement('afterend', liuziBtn);
        liuziBtn.style.display = "block";
    }
});
</script>

<!-- 留咨按钮 end-->
<!--自定义按钮 end-->
正文完
 0
评论(没有评论)

辉哥

一言一句话
-「
最新文章
淘宝店铺转让需要哪些条件,新手能操作吗?

淘宝店铺转让需要哪些条件,新手能操作吗?

淘宝店铺转让需要哪些条件?新手能操作吗?2026最新全攻略 随着电商竞争日益激烈,很多卖家选择淘宝店铺转让来快...
智能客服机器人的优势在哪里?自动化客服系统有哪些核心功能?

智能客服机器人的优势在哪里?自动化客服系统有哪些核心功能?

智能客服机器人的优势在哪里?自动化客服系统有哪些核心功能? 在数字化时代,企业客户服务正迎来深刻变革。智能客服...
智能客服机器人应用了哪些技术?市面上AI客服公司排名如何?

智能客服机器人应用了哪些技术?市面上AI客服公司排名如何?

智能客服机器人应用了哪些技术?市面上AI客服公司排名如何? 随着数字化时代的加速演进,智能客服机器人已成为企业...
智能客服机器人的作用是什么?这种AI机器人技术如何提升客户满意度?

智能客服机器人的作用是什么?这种AI机器人技术如何提升客户满意度?

智能客服机器人的作用是什么?这种AI机器人技术如何提升客户满意度? 在数字化时代,客户服务已成为企业核心竞争力...
智能客服机器人的功能与特点是什么?客服机器人的工作原理是怎样的?

智能客服机器人的功能与特点是什么?客服机器人的工作原理是怎样的?

智能客服机器人的功能与特点是什么?工作原理详解 在数字化时代,智能客服机器人已成为企业提升服务效率的核心工具。...
智能客服机器人的优点有哪些?AI客服如何帮助企业降低运营成本?

智能客服机器人的优点有哪些?AI客服如何帮助企业降低运营成本?

智能客服机器人的优点有哪些?AI客服如何帮助企业降低运营成本? 在数字化时代,企业越来越注重客户体验与运营效率...
知识库怎么建立才能好用?搭建过程中常见问题如何解决?

知识库怎么建立才能好用?搭建过程中常见问题如何解决?

知识库怎么建立才能好用?搭建过程中常见问题如何解决? 在数字化时代,企业知识库已成为提升客服效率、优化用户体验...
淘宝店铺流量提升软件是否可靠,是否影响店铺信誉?

淘宝店铺流量提升软件是否可靠,是否影响店铺信誉?

淘宝店铺流量提升软件是否可靠,是否影响店铺信誉? 在淘宝电商竞争日益激烈的2025-2026年,许多店主为了快...
知识库平台怎么选?AI知识库和传统知识库有何区别?

知识库平台怎么选?AI知识库和传统知识库有何区别?

知识库平台怎么选?AI知识库和传统知识库有何区别? 在企业数字化进程中,知识库平台已成为提升团队协作效率、沉淀...
AI训练系统如何运作?训练场对企业智能化转型有何意义?

AI训练系统如何运作?训练场对企业智能化转型有何意义?

AI训练系统如何运作?训练场对企业智能化转型有何意义? 在数字化时代,企业客服团队的快速成长直接影响服务质量和...
智能客服机器人的优缺点有哪些?企业如何合理部署这类系统?

智能客服机器人的优缺点有哪些?企业如何合理部署这类系统?

智能客服机器人的优缺点有哪些?企业如何合理部署这类系统? 在数字化时代,智能客服机器人已成为越来越多企业提升客...