Custom query string plugin gives a database error that tells “wp_categories doesn’t exist” with wordpress 2.3.I got this error on activating it here on Techblissonline Dot com.This error was thrown when you click on any category.However Custom query string plugin is no longer supported by the original author and hence it has not been upgraded for wordpress 2.3.
Custome query string (CQS) is a cool wordpress plugin that allows you to dislay different number of posts for every different page on your website. For example you can customize your home to display 5 posts per page while you can set it as 15 posts per page for a category.Custome query string plugin thereby allows you to customize different number of posts for pages based on say, archive, autor, category, day, feed, home, month, search and year. Thus you will be able to overcome the default feature in wordpress that lets you display only the same number of posts for all pages on your wordpress blog.
The errors were obviously due to schema changes in wordpress 2.3 where mysql tables like categories, post2cat, and link2cat were replaced by terms, term_taxonomy, and term_relationship tables respectively.So, how do you handle these changes in your unsupported wordpress plugins?
How did I correct “wp_categories doesn’t exist” error in Custom query string plugin?
It is simple.I just replaced the Select query that referenced categories table in custom-query-string.php.i.e.
SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = …
was replaced by
SELECT term_ID FROM $wpdb->terms WHERE slug = …
All i did was to replace categories table with terms,cat_ID column with term_ID and category_nicename column with slug.This resolved the error and i was able to activate Custom query string plugin and use it without any errors.
So if you face any similar kind of error in your unsupported wordpress plugins, then look for the following tables – $wpdb->categories, $wpdb->post2cat, and $wpdb->link2cat and replace them with $wpdb->terms, $wpdb->term_taxonomy, and $wpdb->term_relationship tables.Also make sure that you use the appropriate columns from these new tables.If this sounds too geeky to you, then do contact me or post a comment here.I will support you to resolve the errors in your unsupported plugins.
Current average ratings.