html 用于Wordpress + WPML的更好的IUBENDA代码(不含PHP)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 用于Wordpress + WPML的更好的IUBENDA代码(不含PHP)相关的知识,希望对你有一定的参考价值。

<!-- replace 000001 with the site_id from your specific iubenda embed code -->
<!-- replace 000002 with the policy_id from your EN iubenda embed code -->
<!-- replace 000003 with the policy_id from your IT iubenda embed code -->

<script type="text/javascript">
var lang_id = jQuery('html').attr('lang').split('-')[0]
  , site_id = 000001; // site_id from iubenda embed code

switch( lang_id ){
	case 'en':
		var policy_id = 000002; // policy_id from iubenda embed code EN
		break;
	case 'it':
		var policy_id = 000003; // policy_id from iubenda embed code IT
		break;

	// case 'other language code' ...
}

var _iub = _iub || [];
_iub.csConfiguration = {
	cookiePolicyId: policy_id,
	siteId: site_id,
	lang: lang_id
};
(function (w, d) {
	var loader = function () { var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src = "//cdn.iubenda.com/cookie_solution/iubenda_cs.js"; tag.parentNode.insertBefore(s, tag); };
	if (w.addEventListener) { w.addEventListener("load", loader, false); } else if (w.attachEvent) { w.attachEvent("onload", loader); } else { w.onload = loader; }
})(window, document);
</script>

以上是关于html 用于Wordpress + WPML的更好的IUBENDA代码(不含PHP)的主要内容,如果未能解决你的问题,请参考以下文章

php Wordpress catcha wpml多语言

Wordpress:以正确的语言获取自定义字段值 (WPML)

sql WordPress + WPML:这将两个缺少的列添加到wp_icl_strings(导致WPML字符串翻译表为EMPTY)

WordPress插件配置没有权限

我应该使用哪种 WPML 字符串翻译方法?

创建新菜单项 - Wordpress