使用我们的WordPress站点实现工具提示器,但要碰到障碍。工具提示正确打开,但是工具提示中的内容为空。此代码在WordPress之外工作。请帮助?
这是所有设置的方式。
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(在关闭</head>
之前,在header.php中:
<script> jQuery(document).ready(function() {
jQuery('.ourtip').tooltipster({
theme: 'tooltipster-noir',
contentCloing: true,
contentAsHTML: true
});
});
</script>
3(在需要工具提示的主题中:
<span class="ourtip" data-tooltip-content="#ourtip_content">Tool</span>
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(); ?>
最终是一个冲突的插件。一次禁用WP插件,直到它开始工作,然后找到一个也试图使用工具推动器的插件。停用了该功能和功能。