简体   繁体   English

使用WordPress时工具提示工具提示内容为空

[英]Tooltipster tooltip contents empty when using WordPress

Implementing Tooltipster with our WordPress site, but hit a roadblock. 在我们的WordPress网站上实施Tooltipster,但遇到了障碍。 The tooltips open correctly, but the content within the tooltip is empty. 工具提示正确打开,但是工具提示中的内容为空。 This code works outside of WordPress. 此代码在WordPress之外有效。 Please help? 请帮忙?

Here's how it's all being setup. 这是所有设置的方式。

1) Within functions.php: 1)在functions.php中:

wp_enqueue_style( 'ttcss', '/ours/tt/dist/css/tooltipster.bundle.min.css' );
wp_enqueue_style( 'ttcss-noir', '/ours/tt/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-noir.min.css' );
wp_enqueue_script( 'ttjs', '/ours/tt/dist/js/tooltipster.bundle.min.js', array('jquery'), null, true );

2) Within header.php before closing </head> : 2)在关闭</head>前,在header.php中:

<script> jQuery(document).ready(function() { 
            jQuery('.ourtip').tooltipster({
                    theme: 'tooltipster-noir',
                    contentCloing: true,
                    contentAsHTML: true
            }); 
    }); 
    </script>

3) Within the theme, where the tooltip is desired: 3)在主题内,需要工具提示的位置:

<span class="ourtip" data-tooltip-content="#ourtip_content">Tool</span>

4) Lower down within the theme, what should be displayed (but isn't): 4)在主题下方,应显示(但不应该显示):

<?php
function ours_publisher_popup() 
{
?>
<style>.ourtip_templates {display: none;} </style>
<div class="ourtip_templates">
    <div id="ourtip_content">
        <strong>This text should display but is missing.<br></strong>
    </div>
</div>
<?php
}
ours_publisher_popup(); ?>

Ended up being a conflicting plugin. 最终成为一个有冲突的插件。 Disabled WP plugins one at a time until it started working, and then found one that was also trying to use Tooltipster. 一次禁用WP插件,直到它开始工作,然后才发现一个也在尝试使用Tooltipster的插件。 Deactivated that and functionality returned. 停用该功能并返回功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM