I have a very simple site that I've modified a very small amount. After installing the Yoast SEO plugin I found that it broke the in post media attach/upload. I'm about 80% sure it's related to Jquery but I'm unable to find anything that refer's to it enqueuing anything.
I tried forcing an enqueue from functions.php but it didn't help. Any assistance would be appreciated.
function my_init_method() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', '.5/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
add_action('init', 'my_init_method');
I have a very simple site that I've modified a very small amount. After installing the Yoast SEO plugin I found that it broke the in post media attach/upload. I'm about 80% sure it's related to Jquery but I'm unable to find anything that refer's to it enqueuing anything.
I tried forcing an enqueue from functions.php but it didn't help. Any assistance would be appreciated.
function my_init_method() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis/ajax/libs/jquery/1.5/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
add_action('init', 'my_init_method');
Share
Improve this question
edited Sep 18, 2011 at 10:16
Rarst
100k10 gold badges161 silver badges298 bronze badges
asked Mar 31, 2011 at 7:05
Zach ShallbetterZach Shallbetter
1,2147 gold badges22 silver badges45 bronze badges
5
- 2 Zach, please expound upon your reasoning for blaming 1) jQuery and 2) Yoast's SEO. Log output, etc. Also, please enable WP_DEBUG and look for any errors there. Post the results here and we'll see what we can do. – ZaMoose Commented Mar 31, 2011 at 11:02
- Also, please explain the "modified a very small amount." In WordPress, even a tiny change can have a huge impact ... particularly when jQuery is involved. jQuery 1.5 is actually not working with WordPress (no matter what plugins you use!) – EAMann Commented Mar 31, 2011 at 13:56
- Wow, ok.. I have changed anything within functions.php I haven't added any enqueues or scripts to the site. I've simply modified the css and added a few plugins which I've used for numerous sites. Broken Link Checker, Custom sidebars, DDSlider, Google Analytics for WordPress, Gravity Forms, Image Widget, Magic Gallery, WordPress SEO and WP-DBManager. I disabled/enabled every plugin until I found what was causing the media upload to break. And that happened to be Yoast SEO. – Zach Shallbetter Commented Mar 31, 2011 at 16:00
- Regarding using the debug tool, I'm unsure how to even begin there. I'll have to take a look at the documentation later on. Unless you have a quick suggestion. – Zach Shallbetter Commented Mar 31, 2011 at 16:00
- Add the following to your wp-config.php: define(WP_DEBUG, true); – ZaMoose Commented Mar 31, 2011 at 19:21
1 Answer
Reset to default 4You have introduced 2 additional problems by adding the jQuery from Google CDN.
- The admin interface needs jQuery called in no conflict mode so it won't interfere with the other scripts WordPress uses for the dashboard.
- The WordPress dashboard is not yet compatible with jQuery 1.5 thats why it was pulled from trunk right before 3.1 was released.
See: WordPress Development Blog.
If you want to use Google's jQuery register it like this:
function my_init_method() {
if (!is_admin()) {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis/ajax/libs/jquery/1.5/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
}
add_action('init', 'my_init_method');
Also your using DDSlider and Magic gallery and both use timthumb.php which can cause problems with the default WordPress media functions.
ThemeForest plugins and themes are well known to screw with anything having to do with jQuery even after deactivation.
Almost all Themeforest plugins and themes add their own jQuery via script tags.
I would suggest first removing your enqueue script or change it not to use it in the admin then use Firebug and find out where the breakpoint point is.
Make sure your browsers cache is cleared after you disable any of the plugins for testing.
Another thing you can try is disabling the Ajax meta descriptions in the Yoast plugin and see if that makes a difference.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745164410a4614554.html
评论列表(0条)