Blog Fix: HemingwayEX and WordPress 2.3

by Michael Sheehan on September 25, 2007

in General, Open Source, Software

Last night I upgraded to the latest version of WordPress 2.3. See my previous posts (here and here) for more information. However during the upgrade process, I found an incompatibility with the new Category and Tagging functions and the theme I was using (HemingwayEX). On my homepage, I was getting the following error:

WordPress database error: [Table ‘weblog_td.wp_categories’ doesn’t exist]
SELECT cat_ID FROM wp_categories WHERE cat_name=’Asides’

This error was also appearing when using the HemingwayEX Asides module in my Sidebar. Luckily I had a local copy of my blog running on my laptop and I was able to figure out the differences between the two databases and the tables and fields therein. So, I have posted my results for the benefit of those users who have HemingwayEX as their theme.

In order to fix the code to make things work, this is all that you need to do:

  1. Find, (Download), Open and Edit the “functions.php” file which resides in the “HemingwayEX” folder in the “themes” folder
  2. Locate line 133 (or somewhere near that) that reads:

    return $wpdb->get_var(“SELECT cat_ID FROM ” . $wpdb->categories . ” WHERE cat_name='” . $hemingwayEx_options['asides_category'] . “‘”);

  3. Change that line to read as follows (and note, I commented out the old line so that I could always roll it back; you can comment it out by adding two forward slashes “//”):

    return $wpdb->get_var(“SELECT term_ID FROM ” . $wpdb->terms . ” WHERE name='” . $hemingwayEx_options['asides_category'] . “‘”);

    Note: you may need to change the quotation marks if you cut and paste from this entry. Simplly highlight the quote marks and enter them again using your keyboard.

    • The database items that changed are (pre-2.3 –> post 2.3):
      • cat_ID –> term_ID
      • categories –> terms
      • cat_name –> name
  4. Save your changes to the “functions.php” file and save to your blog theme directory. That’s it!

This worked fine for me (so far). The error disappeared from my homepage and my HemingwayEX Asides Sidebar module started working properly again. Hope this works for you!

HTD Says: “Hack” your functions.php page to make the HemingwayEX theme and WordPress 2.3 work in synergy!

Print Friendly
  • http://www.tausendplateaus.de Cas

    I have the same problem but when I tried your fix, I got a Parse Error, that seems to be because when I installed the Theme (which I really love) I deleted the Slidebar function out of the index.php (not being the best coder, so perhaps I did it a little sloppy from a coders point of view) because I wanted the pure posts to qppear on top of the page and nothing else.

    If you have any suggestions… that would really be appreciated!

  • http://www.tausendplateaus.de Cas

    I have the same problem but when I tried your fix, I got a Parse Error, that seems to be because when I installed the Theme (which I really love) I deleted the Slidebar function out of the index.php (not being the best coder, so perhaps I did it a little sloppy from a coders point of view) because I wanted the pure posts to qppear on top of the page and nothing else.

    If you have any suggestions… that would really be appreciated!

  • http://www.hightechdad.com hightechdad

    Cas,

    I just visited your site and I saw the same error that I had. However, I just refreshed it and it went away. Did you apply my fix? Let me know!
    -HTD

  • http://www.hightechdad.com Michael

    Cas,

    I just visited your site and I saw the same error that I had. However, I just refreshed it and it went away. Did you apply my fix? Let me know!
    -HTD

  • http://www.tausendplateaus.de Cas

    Without your hint, it would not have been possible to get my site running without the error again I guess, not in such a short time.
    What I did was deleting (okay, not the best option ;)) that part of the code you pointed out and eveything changed back to normal.

    I checked out the main functions of my site and it seems to work as usual. Thank you very very much for your help, the web needs more people like you! All the best!

  • http://www.tausendplateaus.de Cas

    Without your hint, it would not have been possible to get my site running without the error again I guess, not in such a short time.
    What I did was deleting (okay, not the best option ;)) that part of the code you pointed out and eveything changed back to normal.

    I checked out the main functions of my site and it seems to work as usual. Thank you very very much for your help, the web needs more people like you! All the best!

  • http://www.jenst.se Jens

    Great, thanks! =)

  • http://www.jenst.se Jens

    Great, thanks! =)

  • http://aaron.panasbodi.com Aaron

    Hey, thanks for the tip.

    Any idea how to edit the tag.php file to work with the new tagging system? I’m getting a “Fatal error: Call to undefined function: utw_showcurrenttagset()” error after converting categories to tags..

    – Aaron

  • http://aaron.panasbodi.com Aaron

    Hey, thanks for the tip.

    Any idea how to edit the tag.php file to work with the new tagging system? I’m getting a “Fatal error: Call to undefined function: utw_showcurrenttagset()” error after converting categories to tags..

    – Aaron

  • ilysah

    I came here from Nalin’s forum. Thanks so much for the hack to the category field. It worked fine.

    I’m very new to WP and know basic coding by following instructions. I’ll get there eventually. Do I need to install a plugin to make the Aside category work? I chose to widgetized my HemingwayEX theme. I also selected the recommendation to use the name Asides as the category on the option page. But my post keeps showing up as a regular post.

    Any help in solving this would greatly be appreciated.

  • ilysah

    I came here from Nalin’s forum. Thanks so much for the hack to the category field. It worked fine.

    I’m very new to WP and know basic coding by following instructions. I’ll get there eventually. Do I need to install a plugin to make the Aside category work? I chose to widgetized my HemingwayEX theme. I also selected the recommendation to use the name Asides as the category on the option page. But my post keeps showing up as a regular post.

    Any help in solving this would greatly be appreciated.

  • http://www.hightechdad.com hightechdad

    @ Aaron

    I haven’t taken a deeper look yet at other things that might be not working completely right with HemingwayEX. But I will dig some more later when I have time.

    @ ilysah

    You don’t need a plug-in. So, you are saying that you set the category as “Asides” in the HemingwayEX Options? Under the Presentation > Widgets, did you drag the Asides Widget to one of the sidebars? Also, when you post, you need to be sure that the ONLY category you use is the “Asides” one, otherwise it WILL show up as a post and not an Asides.

    Hope that helps!
    -HTD

  • http://www.hightechdad.com Michael

    @ Aaron

    I haven’t taken a deeper look yet at other things that might be not working completely right with HemingwayEX. But I will dig some more later when I have time.

    @ ilysah

    You don’t need a plug-in. So, you are saying that you set the category as “Asides” in the HemingwayEX Options? Under the Presentation > Widgets, did you drag the Asides Widget to one of the sidebars? Also, when you post, you need to be sure that the ONLY category you use is the “Asides” one, otherwise it WILL show up as a post and not an Asides.

    Hope that helps!
    -HTD

  • Mosey

    Hi TechDad,
    Thanks for your post :) I haven’t yet made the changes as per your post (but will do) but was wondering how to change the ‘tags’ page to display *only* the current tag?
    For instance, if I click on ‘Cellular’ it will take me to the page with posts all tagged with ‘Cellular’. I’ve tried using ‘the_tags’ and ‘wp_tag_cloud’ but the first gives no result, and the latter gives me a list of all the most popular tags like a tag cloud instead.
    Any help would be much appreciated! :D
    Thanks!

  • Mosey

    Hi TechDad,
    Thanks for your post :) I haven’t yet made the changes as per your post (but will do) but was wondering how to change the ‘tags’ page to display *only* the current tag?
    For instance, if I click on ‘Cellular’ it will take me to the page with posts all tagged with ‘Cellular’. I’ve tried using ‘the_tags’ and ‘wp_tag_cloud’ but the first gives no result, and the latter gives me a list of all the most popular tags like a tag cloud instead.
    Any help would be much appreciated! :D
    Thanks!

  • http://smate.sk smate

    wow finally I found solution
    thanks a lot

  • http://smate.sk smate

    wow finally I found solution
    thanks a lot

  • http://www.hightechdad.com hightechdad

    @ Mosey,

    Hmmm. I haven’t dug around the coee yet and I have a feeling there are probably some other things that need to be fixed.

    @ Smate,

    Glad it worked out for you!

    -HTD

  • http://www.hightechdad.com Michael

    @ Mosey,

    Hmmm. I haven’t dug around the coee yet and I have a feeling there are probably some other things that need to be fixed.

    @ Smate,

    Glad it worked out for you!

    -HTD

  • Darren

    Do anyone know how to make wp_post2cat compatible with WP2.3??

  • Darren

    Do anyone know how to make wp_post2cat compatible with WP2.3??

  • http://melons.vicp.net David

    Great, thx!

  • http://melons.vicp.net David

    Great, thx!

  • Gwytherinn

    Thanks a ton for this fix, I just implemented it and everything seems to be working great. I love what you’ve done with your site and the changes you’ve made to HemingwayEx… will definitely be lurking around to get more of an idea of what you’ve done!

  • Gwytherinn

    Thanks a ton for this fix, I just implemented it and everything seems to be working great. I love what you’ve done with your site and the changes you’ve made to HemingwayEx… will definitely be lurking around to get more of an idea of what you’ve done!

  • http://www.hightechdad.com hightechdad

    @ Darren,

    I haven’t looked for it specifically, but you can probably open the file that contains it and look to replace the same items that I mentioned above.

    @ David,

    Your welcome!

    @ Gwytherinn,

    You are welcome as well. Glad that you like the site…took a little while to get the CSS the way that I wanted it. If others like it, I may release it some time…that is, when I actually have time to do so (grin).

    -HTD

  • http://www.hightechdad.com Michael

    @ Darren,

    I haven’t looked for it specifically, but you can probably open the file that contains it and look to replace the same items that I mentioned above.

    @ David,

    Your welcome!

    @ Gwytherinn,

    You are welcome as well. Glad that you like the site…took a little while to get the CSS the way that I wanted it. If others like it, I may release it some time…that is, when I actually have time to do so (grin).

    -HTD

  • http://www.dmblog.ca/ Daniel Menjivar

    I’m having a different problem. The recent posts block does not work on my homepage, but it does on the post pages – any idea how I can fix this? Thanks in advance!

    DM
    DMblog.ca

  • http://www.dmblog.ca/ Daniel Menjivar

    I’m having a different problem. The recent posts block does not work on my homepage, but it does on the post pages – any idea how I can fix this? Thanks in advance!

    DM
    DMblog.ca

  • http://www.ramoncutanda.com Ramón Cutanda

    Thanks!

  • http://www.ramoncutanda.com Ramón Cutanda

    Thanks!

  • http://www.hightechdad.com hightechdad

    To everyone who is subscribed to this, please check my post on how to get things working without UltimateTagWarrior and using the new WP 2.3 tagging. Post is here.

    Hope it works for you! LMK!

    -HTD

  • http://www.hightechdad.com Michael

    To everyone who is subscribed to this, please check my post on how to get things working without UltimateTagWarrior and using the new WP 2.3 tagging. Post is here.

    Hope it works for you! LMK!

    -HTD

Previous post:

Next post: