2016-07-28 130 views
0

我将静态HTML模板转换为用于WordPress的php成功。问题是HTML模板有几个jQuery插件的滑块,见证,猫头鹰旋转木马&其他一些JavaScript min.js,从而未能在浏览器中加载。我尝试添加将静态HTML模板转换为wordpress-JavaScript&Jquery问题

<?php wp_enqueue_script('jquery'); ?> 

的jQuery,然后

<script src="<?php bloginfo('template_url'); ?>/js/jquery-1.12.4.min.js" type="text/javascript"></script> 
<script src="<?php bloginfo('template_url'); ?>/js/plugin/jquery.easing.js" type="text/javascript"></script> 
<script src="<?php bloginfo('template_url'); ?>/js/jquery-ui.js" type="text/javascript"></script> 

许多脚本是有这样的,但所有的失败。即使滑块,下面

<!--Main Slider--> 
<link href="<?php bloginfo('template_url'); ?>/template-parts/css/settings.css" type="text/css" rel="stylesheet" media="screen"> 
<link href="<?php bloginfo('template_url'); ?>/template-parts/css/layers.css" type="text/css" rel="stylesheet" media="screen"> 
<link href="<?php bloginfo('template_url'); ?>/template-parts/css/style.css" rel="stylesheet" type="text/css"> 
<link href="<?php bloginfo('template_url'); ?>/template-parts/css/responsive.css" rel="stylesheet" type="text/css"> 

<!--Theme Color--> 
<link href="<?php bloginfo('template_url'); ?>/template-parts/css/theme-color/default.css" rel="stylesheet" id="theme-color" type="text/css"> 

即使在页脚文本的默认字体大小给予在WordPress footer.php文件编辑文本后已更改为小。标题中的菜单没有该悬停效果,因为它处于临时状态。 error log snippet

回答

0

使用函数来调用CSS和js.for后端使用admin_enque_script和wp_enque script.and请用寄存器函数来调用CSS和JS调用的文件

+0

之前,但我已经提到过<?PHP wp_enqueue_script( '的jquery'); ?> 在header.php中。在哪里添加上述方法先生。请详细说明,因为我是wordpress新手。我们是否必须在functions.php中提到这一点。会是什么样的语法。 – kk19

+0

有太多的enqueue_script,enqueue_style,enqueue_register。我感到困惑 – kk19