Thesis Theme 1.5 with Wordpress 2.8

Post image for Thesis Theme 1.5 with Wordpress 2.8

by Anthony on 20 May, 2009

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.

{ 2 trackbacks }

Posts about Wordpress Widgets as of May 20, 2009 Wordpress Theme | Free Quality Wordpress Themes @ List-Your-Blog.com
21 May, 2009 at 8:02 am
WordPress 2.8 - What’s New?! | Andrew Byrn3 | A Lifestream
7 June, 2009 at 6:50 am

{ 4 comments… read them below or add one }

Mike 24 May, 2009 at 6:46 am

Hi, nice posts there :-) thank’s for the interesting information

Ebook Cover Templates 18 June, 2009 at 4:36 pm

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!

Anthony 18 June, 2009 at 9:18 pm

Hi Yvonne,

Thanks for coming by. Its worth noting that Thesis 1.5.1 has been released now, and fixes this problem.

Leave a Comment