Thesis 1.5 on WordPress 2.8RC

Thesis Theme for WordPress The next version of Thesis will include rockin’ WordPress 2.8 compatibility and work has progressed toward that end in SVN. However, if you’re wanting to use the latest, greatest version of WordPress, which is now available in release candidate flavor, you’re either going to have to survive without a widgets panel for the time being, or you can apply this quick fix.

By now, I hope you are running Thesis 1.5.1, which works perfectly with WordPress 2.8 (which you should also be running by now) and makes the following code edits completely unnecessary. Enjoy. :)

Open the file wp-content/themes/thesis/lib/admin/admin.php (your thesis/ directory may be named something else), and find this block of code:

function thesis_admin_styles_and_scripts() {
	global $wp_version;
	$new_admin_version = '2.7';
	$installed_version = $wp_version;

	if (version_compare($installed_version, $new_admin_version, '<')) {
		add_action('admin_head-design_page_thesis-options', 'thesis_options_stylesheet');
		add_action('admin_head-design_page_thesis-design-options', 'thesis_options_stylesheet');
		add_action('admin_print_scripts-design_page_thesis-options', 'thesis_options_js_deprecated');
		add_action('admin_print_scripts-design_page_thesis-design-options', 'thesis_options_js_deprecated');
	}
	else {
		add_action('admin_head', 'thesis_options_stylesheet');
		add_action('admin_head', 'thesis_options_js');
	}
}

That is the block of code which queues Thesis’ admin panel styles and JavaScript. The problem lies in that our JavaScript interferes with WordPress' new widget handling on the Widgets panel. This is simple enough to rectify. Once you've found the above block of code, replace it with this new block of code:

function thesis_admin_styles_and_scripts() {
	if ('themes.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
		global $wp_version;
		$new_admin_version = '2.7';
		$installed_version = $wp_version;
	
		if (version_compare($installed_version, $new_admin_version, '<')) {
			add_action('admin_head-design_page_thesis-options', 'thesis_options_stylesheet');
			add_action('admin_head-design_page_thesis-design-options', 'thesis_options_stylesheet');
			add_action('admin_print_scripts-design_page_thesis-options', 'thesis_options_js_deprecated');
			add_action('admin_print_scripts-design_page_thesis-design-options', 'thesis_options_js_deprecated');
		}
		else {
			add_action('admin_head', 'thesis_options_stylesheet');
			add_action('admin_head', 'thesis_options_js');
		}
	}
}

Save the file, upload it to the proper place on your server, and enjoy!

Now for the following N.B., which I strongly suggest you do not skip if you are not prepared to troubleshoot things that go wrong:

If you're not using WordPress 2.8, there's no need to make the above change!

If you're not using version 1.5 of Thesis, you may not have to do anything. Honestly, I don't know as older versions are not being tested against cutting edge WordPress code. You are urged to upgrade to Thesis 1.5.

Ordinarily, core edits of Thesis are not only not encouraged but are actively discouraged in the interest of quick and easy upgrades. In this instance, because the upgrade will alleviate the need to make this core file modification, there's no risk. Enjoy.

Okay, I lied when I said there was no risk! Modifying core files can completely and utterly destroy your site! Ensure that you have an unchanged, working copy of wp-content/themes/thesis/lib/admin/admin.php so that you can revert back to if need be.

Everything else in Thesis should work fine on the new version of WordPress, but if any other issues come up, please report it on our support forums! Your help in reporting bugs helps make Thesis better for everyone!

44 thoughts on “Thesis 1.5 on WordPress 2.8RC”

  1. Rick: I’ve just upgraded to WP 2:8RC1 and am running Thesis 1.5, but cannot replicate the problem you’re referring to above. Could expand on the exact issue so I can see if I’m “suffering” and whether I need to make the core code change.

    Further, do you know when an update will be released that fixes any WP2.8 issues officially?

  2. Rick, this is great stuff. I invite you guys to consider it for a Thesis 1.51RC, if for no other reason that when 2.8 goes final on Tuesday, many WP auto-installers will default to it. Anyhow, thanks!

  3. The exact problem was that the WordPress Widgets panel didn’t work; the JavaScripts included by Thesis prevented the drag and drop functionality of the widgets which pretty much defeated the whole purpose of the page.

    Also, I have no control over releases or our schedule — my personal schedule is crazy over the next few days, that’s all I know — but Chris may push for a release. I dunno. :)

  4. Rick is just right the drag drop widget is not working in wp 2.8. I already have this problem with beta. I was thinking it is the bug from wp 2.8 but its the problem of thesis.

  5. Hi Rick,

    I’m writing a plugin for a client, in which I add an admin page for options under Appearance. (add_theme_page())

    On this page, I use wp_enqueue_script('jquery-ui-tabs'), and I’ve discovered that this still clashes with the fix you describe here. I realize there’ll be a new Thesis version released soonish, but figured you should know.

    In the Thesis file /lib/admin/admin.php is a function called thesis_options_js() which echo’s [script] tags. Better to use wp_enqueue_script(), and to use the jQuery that comes with WordPress, instead of the version you included with Thesis.

    Refer: http://www.fergusweb.net/coding/thesis-15-with-wordpress-28/

  6. Thanks, Anthony. My fix above was the quickest, easiest thing to get Thesis working right away. Enqueuing the scripts via WordPress’ functions is definitely the way to go, and I sent Chris a pointer to your site and fix. Thanks again!

  7. Thank you rick, i was almost wild when i saw widgets not working in my Admin panel with Thesis installed.

    Your fix worked great. Thank you again

  8. Another way to get around this for the time being is click on “screen” and “accessiblity mode”. This lets you move your widgets to the sidebars and configure them for the time being until Thesis is updated. It’s a LOT easier and requires no code modification.

  9. I just tried this fix, and it killed the stylesheet for my Thesis options panel. Any ideas for how I can fix the widgets and keep the same functionality in my options panel?

  10. Kingdom,

    You state above ,” Updating to Thesis 1.5.1 makes the above fix completely unnecessary. WordPress 2.8 and Thesis 1.5.1 play perfectly together”.

    Well I have Thesis 1.5.1 and upgraded to W2.8 but I still have a widget problem!

    ie: I drag a text widget over to sidebar #1 or even to #2 and enter a title then copy/paste a link with an image and click save. Instead of seeing a green save progress bar on the browser bottom toolbar, I see a whirling circle. The circle whirls and stops BUT nothing gets saved. More save attempts meet without success. Redoing the entire exercise also fails to result in a new and save widget to my sidebar. No evidence appears on the sidebar either.

    What could this be? Any ideas?

    Regards

    RB@p45camp

  11. This is definitely a Thesis issue. Until this is fixed, you can temporarily activate a different theme, drag and drop your heart out and then reactive Thesis.

  12. Yay! Indeed, the upgrade fixed it beautifully! For those who need a tutorial on how to download/install, just jump over to the downloads page and you’re good to go. Thanks for the quick fix! LOVE THESIS!!! :)

  13. I’m on Thesis 1.5.1 and I don’t get the text widget working either. Has Chris sneaked another fix into the current download since 1.5.1 was first released?

  14. I upgraded to Thesis 1.5.1 with version WP 2.8 running and still get frozen widgets. Do I also need to upgrade to WP 2.8RC to fix this? Please let me know I need to launch my new site in a few days!

  15. The widgets should work fine with the first available version of Thesis 1.5.1 — that whole release was motivated by the widgets-fix — with WordPress 2.8 (2.8.1 dev versions aren’t required).

    If the widgets are still not working, chances are that some other plugin’s JavaScript is breaking things. The source of the problem with frozen widgets was Thesis’ JavaScript being included on that page. Thesis 1.5.1 prevents that, and because Thesis does nothing else to the page, I’m not sure that Thesis *can* break the panel in any other way.

    Verify all the usuals:

    * All plugins disabled
    * All Thesis customizations removed
    * All Thesis files uploaded properly
    * All caches (browser, WordPress plugin) cleared
    * Google Gears disabled (“Turbo” link in the upper-right of admin panel)

    and so on.

  16. Rick,
    We tried those suggestions but my widget sidebars are still frozen. I thinking of upgrade to 2.8 beta 1 – but worried it may break something else. Any other suggestions?

  17. I just figured out what the problem was… I only had to do this for the widgets to work again:

    If you are using WordPress 2.8, try this:
    1. From the Admin panel click Appearance, then Widgets.
    2. Click on the button labeled “Screen Options” in the upper right hand corner.
    3. Choose “Accessibility Mode.”

    Just in case anyone else has the same problem!!!!

  18. pdg: That’s already been reported above. However, if you’re using Thesis 1.5.1, the widgets will work just fine. If not, there’s another plugin or customization conflicting. It’s not Thesis’ fault. Promise. :)

  19. Hmm, the only thing I’ve changed is to completely remove Google Gears (it was already disabled, but not uninstallable from within Firefox, so I used Control Panel -> Add/Remove Programs to nuke it, and now my text widget seems to be working just fine. Very odd.

  20. Thanks, pdg for your easy remedy, I was able to make my widgets work without any coding changes. I was about to look for a new WP 2.8-ready theme even if I liked very much my old Revolution theme.

  21. Rick,

    try as I might, I don’t know how to get Thesis to s=display teaser posts beside each other instead of vertically down the left margin.

    How do you group teasers in horizontal lines of two or three?

    Be well & kind regards

    Robert@p45camp.com

  22. Side-by-side is the default setup. If they aren’t working that way, there may be a customization or something interfering. You’ll need to ask on the Thesis support board for further help, though, as this isn’t the thread for general Thesis support matters.

  23. Hi Rick,

    I am running thesis 151 and am getting this problem?? i tried the script you gave and all hell broke loose on my back end. Do you have any suggestions on what could be causing the problem?

    Thanks
    Michael

  24. You probably have either outdated scripts cached in your browser or an incompatible plugin activated. For further help, you’ll want to ask at the DIYthemes support board. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>