简体   繁体   English

WordPress快速编辑+添加媒体按钮不起作用

[英]Wordpress quick edit + add media buttons not working

i just upgraded to Wordpres 3.6.1 and i have an issue, for the default twenty-twelve theme the add media and quick edit buttons work okay but when i created my own custom theme those buttons stopped working. 我刚刚升级到Wordpres 3.6.1,但遇到一个问题,对于默认的二十二个主题,添加媒体和快速编辑按钮可以正常工作,但是当我创建自己的自定义主题时,这些按钮将停止工作。 I have not yet installed any plugins into my site and i have been searching for a solution for a while now, i need some help on this. 我尚未在网站上安装任何插件,并且我一直在寻找解决方案已有一段时间,因此我需要一些帮助。

Some research i did suggested that it may be as a result of additional javascript files i added to my website, so i'm now wondering if there is special way to link these .js files in wordpress. 我确实提出了一些研究建议,这可能是由于我在网站上添加了其他javascript文件所致,所以我现在想知道是否存在特殊的方法来在wordpress中链接这些.js文件。

These are the scripts i'm currently using in the "header.php" file: 这些是我目前在“ header.php”文件中使用的脚本:

<script src="<?php bloginfo('template_url'); ?>/js/jquery-1.10.2.min.js"></script>
<script src="<?php bloginfo('template_url') ?>/slider/anythingfader.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url') ?>/js/jquery.simplyscroll.min.js"></script>

Please note: This is NOT a graphical issue, like what was implied in a different but wordpress related post i made before. 请注意:这不是图形问题,就像我之前在另一篇与wordpress相关的文章中所暗示的一样。

You should enqueue your scripts with wordpress if your adding additional scripts. 如果添加其他脚本,则应使用wordpress使脚本排队。

I would define the javascript directory in your functions.php file. 我将在您的functions.php文件中定义javascript目录。 Something like this: 像这样:

Then create a function 然后创建一个函数

define('MY_JS', get_bloginfo('stylesheet_directory') . '/js/' );


function reg_scripts() {
wp_register_script('jquery.easing.min', MY_JS .'jquery.easing.min.js', false, false, true);
wp_enqueue_script('jquery.easing.min');

}
add_action( 'wp_enqueue_scripts', 'reg_scripts' );

This should load it in the footer. 这应该将其加载到页脚中。 Also - if your loading a different jquery then the one shipped it may prevent the other version from working. 另外-如果您加载的是其他jquery,则该jquery可能会阻止其他版本的jquery正常工作。 If you need to deregister the shipped jquery version you can add this into the function above 如果您需要注销已发布的jquery版本,则可以将其添加到上面的函数中

wp_deregister_script( 'jquery' );

Try this out. 试试看 I guess it has to do with the new version of Wordpress which is 3.6.1 我想这与3.6.1的新版Wordpress有关

<?php  echo get_stylesheet_directory_uri()?>/js/jquery-1.10.2.min.js">
<?php  echo get_stylesheet_directory_uri()?>/slider/anythingfader.js">
<?php  echo get_stylesheet_directory_uri()?>/js/jquery.simplyscroll.min.js">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM