如何在WordPress(API)中设置一些JavaScript

时间:2019-05-05 10:46:41

标签: javascript wordpress api

我有这段代码,但我无法在WordPress中使用它,我使用了插件Traceback (most recent call last): File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\parek\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\parek\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found. Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import tensorflow as tf File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 24, in <module> from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\parek\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\parek\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\parek\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found. ...但是我不确定为什么它不起作用,页面只是空白。

我该如何使用它?我应该在WordPress网站中放置什么-插件等?

我试图将其放置在“ HTML代码”下的“ WP CODER”中:

但是它不起作用,页面为空白。

1)将以下代码添加到您网站的Insert Headers & Footers部分:

WP Coder href =” https://zellr.com/integration/kirpparikalle.css” />

2)将以下代码添加到页面部分。将其放在您希望查看登录和注册表格的元素内。

<head>

它应该在页面上显示一些预订模块。

2 个答案:

答案 0 :(得分:0)

您正在使用块编辑器(古腾堡)还是经典编辑器?

在经典编辑器中。将您的代码粘贴到文本编辑器中 enter image description here

古腾堡(Gutenberg tho)中的概念相同。

答案 1 :(得分:0)

尝试复制此确切的代码并将其粘贴到您希望其显示的位置,因为您在网站上应用的代码中包含奇数字符。另外,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>