javascript - 如何在 WordPress (API) 中设置一些 JavaScript
问题描述
我有这个代码,但我无法让它在我的 WordPress 中工作,我已经使用了插件Insert Headers & Footers
,而且WP Coder
......但我不确定它为什么不起作用,页面只是空白。
我怎样才能让它工作?我应该在 WordPress 网站的什么位置放置 - 插件等?
我试图把它放在“HTML 代码”下的“WP CODER”中:
但它不起作用,页面是空白的。
1)将以下代码添加到<head>
您网站的部分:
<link rel="stylesheet" type="text/css"
href="<a href="https://zellr.com/integration/kirpparikalle.css" rel="nofollow noreferrer">https://zellr.com/integration/kirpparikalle.css" />
2)将以下代码添加到页面的部分。将它放在您希望查看登录和注册表单的元素中。
<h1 id="kirpparikalle_title"></h1>
<br/>
<div id="kirpparikalle_container"></div>
<!-- Note: jQuery is requirement for the integration scripts.
If you already have jQuery included in your website, you can remove the next line. -->
<script type="text/javascript" ```src="https://zellr.com/integration/jquery.min.js"></script>
<script type="text/javascript" ```src=”https://zellr.com/integration/kirpparikalle_i18n.js"></script>
<script type="text/javascript">
$(function() {
KK_COMPANY = ' denlillelandsoldat ';
KK_CONFIG['redirect_url'] = 'http://denlillelandsoldat.dk/';
KK_LANGUAGE = 'da';
kk_show_default_login();
});
</script>
它应该在页面上显示一些预订模块。
解决方案
尝试复制此确切代码并将其粘贴到您希望它出现的位置,您在网站上应用的代码中有奇怪的字符。此外,js 代码可能会产生错误以对包装器进行一些更改
<link rel="stylesheet" type="text/css" href="https://zellr.com/integration/kirpparikalle.css" />
<div id="kirpparikalle_container"></div>
<!-- Note: jQuery is requirement for the integration scripts.
If you already have jQuery included in your website, you can remove the next line. -->
<script type="text/javascript" src="https://zellr.com/integration/jquery.min.js"></script>
<script type="text/javascript" src="https://zellr.com/integration/kirpparikalle_i18n.js"></script>
<script type="text/javascript">
(function($) {
$(function() {
KK_COMPANY = ' denlillelandsoldat ';
KK_CONFIG['redirect_url'] = 'http://denlillelandsoldat.dk/';
KK_LANGUAGE = 'da';
kk_show_default_login();
})( jQuery );
</script>
推荐阅读
- java - 找不到菜单 ID
- php - 为 phpmailer 设置退回邮件
- angular - Angular Chrome 扩展 PDFMerge(需要)
- reactjs - 用于创建反应应用程序的自定义反应脚本不起作用
- spring-data-jpa - 额外的查询被触发以获取序列下一个值-spring JPA
- reporting-services - SSRS - 如何创建表达式列的总和(总计)?
- azure - 创建资源时触发 Azure Function
- postgresql - 无法在 PostgreSQL 中删除模式
- python - 如何按文本查找元素,但它是硒中的数字
- ios - 通过颤振从 iPhone 发送短信