使用Wordpress和Understrap。当我安装代码时:
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-
forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false">
</script><script type="text/javascript">require(["mojo/signup-
forms/Loader"], function(L) { L.start({"baseUrl":"mc.us1.list-
manage.com","uuid":"5792cac24346d164eb0cf6ad2","lid":"c1462a4600"}) })
</script>它工作并为电子邮件订阅创建弹出窗口,我收到以下错误:
theme.min.js?ver=0.5.7:2 Uncaught Error: Bootstrap tooltips require Tether
(http://tether.io/)
at theme.min.js?ver=0.5.7:2
at theme.min.js?ver=0.5.7:3
at theme.min.js?ver=0.5.7:3
(anonymous) @ theme.min.js?ver=0.5.7:2
(anonymous) @ theme.min.js?ver=0.5.7:3
(anonymous) @ theme.min.js?ver=0.5.7:3和:
woocommerce.min.js?ver=3.2.6:1 Uncaught ReferenceError: Cookies is not
defined
at HTMLDocument.<anonymous> (woocommerce.min.js?ver=3.2.6:1)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)在我的主题中使用的js和ajax在页面上不再有效。如果您转到REMOVED,您可以看到我使用了ajax和js,因此当您单击artists图标时,它会显示系列,然后显示链接到产品页面的产品。一旦我安装了MailChimp弹出代码,ajax或js都不起作用,所以如果你点击这些图标,什么都不会发生。
我的theme.js文件一直包含Tether1.4,并且在Bootstrap之前。
我该怎么办?
发布于 2018-05-12 02:37:24
当您在WordPress实现中安装MailChimp代码时,请确保通过指定一个非常大的priority将其放在页脚的最后。
如下所示:
add_action( 'wp_footer', 'so_48236002', PHP_INT_MAX );
function so_48236002() { ?>
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us1.list-manage.com","uuid":"5792cac24346d164eb0cf6ad2","lid":"c1462a4600"}) })</script>
<?php }请注意,PHP_INT_MAX常量非常大。建议您进行相应的设置。;)
https://stackoverflow.com/questions/48236002
复制相似问题