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:
- Find, (Download), Open and Edit the “functions.php” file which resides in the “HemingwayEX” folder in the “themes” folder
- 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’] . “‘”);
- 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
- The database items that changed are (pre-2.3 –> post 2.3):
- 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!
34 Responses
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!
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!
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
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
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!
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!
Great, thanks! =)
Great, thanks! =)
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
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
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.
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.
@ 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
@ 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
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!
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!
wow finally I found solution
thanks a lot
wow finally I found solution
thanks a lot
@ 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
@ 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
Do anyone know how to make wp_post2cat compatible with WP2.3??
Do anyone know how to make wp_post2cat compatible with WP2.3??
Great, thx!
Great, thx!
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!
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!
@ 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
@ 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
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
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
Thanks!
Thanks!
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
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