I’ve been playing with the newest version of WordPress (2.8), which is due to be released in the near future. It features a completely new way of writing Widgets, so I've been testing that out.
I discovered a clash with my favourite wordpress theme, the Thesis framework. Took me a little while to figure it out, but I think I've solved the problem.
Update 18 June 09: Thesis 1.5.1 has been released, and makes this patch unneccessary.
The problem
Wordpress 2.8 features an excellent Widget manager in the admin area. But with Thesis 1.5, this area is unusable. Widgets cannot be dragged/dropped, which is essential. It seems that the JS provided by Thesis clashes with JS provided by Wordpress on a few different screens.
The fix
Open up your Thesis files, and look in /lib/admin/admin.php
. Look for function thesis_options_js()
$date_modified_js = filemtime(THESIS_SCRIPTS . '/thesis.js');
$date_modified_ui = filemtime(THESIS_SCRIPTS . '/jquery-ui.js');
echo '<script type="text/javascript" src="' . THESIS_SCRIPTS_FOLDER . '/thesis.js?d=' . date('mdy-Gms', $date_modified_js) . '" /></script>' . "\\n";
echo '<script type="text/javascript" src="' . THESIS_SCRIPTS_FOLDER . '/jquery-ui.js?d=' . date('mdy-Gms', $date_modified_ui) . '" /></script>' . "\\n";
Thesis comes with its own jQuery UI script, which clashes with the in-built wordpress scripts. Replace that function with this one:
if (!is_admin()) { return; }
$date_modified_js = filemtime(THESIS_SCRIPTS . '/thesis.js');
$date_modified_ui = filemtime(THESIS_SCRIPTS . '/jquery-ui.js');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('thesis-admin-js', THESIS_SCRIPTS_FOLDER.'/thesis.js');
Also look for the function thesis_admin_styles_and_scripts()
It contains this:
add_action('admin_head', 'thesis_options_stylesheet');
add_action('admin_head', 'thesis_options_js');
Replace with this:
add_action('admin_head', 'thesis_options_stylesheet');
add_action('admin_head', 'thesis_options_js');
add_action('init', 'thesis_options_js');
And problem solved! So far I haven't discovered any unwanted side-affects. You may only need to enqueue jquery-ui-sortable.
Update 18 June 09: Thesis 1.5.1 has been released, and makes this patch unneccessary.
Comments
Thanks very Much Anthony,
It worked like a charm.
Before that, I was wondering what the problem was - not realizing that wp 2.8 wasn’t compatible with thesis.
Very much appreciated!
Hi Yvonne,
Thanks for coming by. Its worth noting that Thesis 1.5.1 has been released now, and fixes this problem.