Jquery UI排序表在Wordpress中不工作

Jquery UI排序表在Wordpress中不工作,jquery,wordpress,jquery-ui-sortable,Jquery,Wordpress,Jquery Ui Sortable,我是wordpress的新手,所以我还不确定一切进展如何 我试图使用 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> 但我的问题是: 1.我应该把这个代码放在哪里? 2.我是否需要创建一个wp\u register\u脚本来执行此操作? 3.是否删除标题中包含的标记? 4.Wordpress知道什么是jquery ui sortable,或者我需要包含另一个文件吗?错误是由于缺

我是wordpress的新手,所以我还不确定一切进展如何

我试图使用

<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
但我的问题是: 1.我应该把这个代码放在哪里? 2.我是否需要创建一个wp\u register\u脚本来执行此操作? 3.是否删除标题中包含的标记?
4.Wordpress知道什么是jquery ui sortable,或者我需要包含另一个文件吗?

错误是由于缺少jquery库。您需要在jQuery UI之前包括jQuery库,如下所示:

<head>
<!-- jQuery reference -->
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<!-- jQuery UI reference -->
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body></body>

请将这两个脚本排队,问题将得到解决

wp_enqueue_script('jquery-ui-core');
wp_enqueue_script( 'jquery-ui-sortable');

查看页面的源。。应在使用.sortable函数的脚本之前加载jquery ui可排序文件
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script( 'jquery-ui-sortable');