This plugin works with Wordpress 2.3.3 and Wordpress 2.5
Update: After a long time, I finaly had the chance to update and fix the bugs in the plugin. From v0.1b, I can now say that it’s a true v1.0. This should work with the latest versions of Wordpress now. Just overwrite themed-categories.php with the latest version and you’re all set.
2008-04-24: Fixed the redirect bug. Plugin no longer needs to redirect now.
Download Themed Categories Plugin v1.0
Introduction
I had to create my first wordpress plugin due to necessity. One of my clients require that he be able to assign different themes for each category. I have seen this feature in the Wordpress Subdomain Plugin but I can’t use it as is since my client doesn’t want his categories to be subdomains. I looked at the code of said plugin and said to myself, “heck, this is easy.”
Inspired by the subdomain plugin, I decided to write my own plugin learning from both actual code and the wordpress plugin API. In approximately 4 hours, I was able to come up with my very first Wordpress Plugin and I love it! Hehehe.
Introducing, the Themed Categories Plugin. It’s in its early stages so I will be glad if any of you can help me improve it. With it, you can assign different themes to each of your wordpress categories.
How to Install
To install it, just download the file, unzip it to your wordpress plugins folder and activate it.
How to Use
To use it, simply go to Manage->Categories, edit the category you wish to assign a theme to, select the theme from the “Select category themed” dropdown, and save it.
Disclaimer
Lastly, I haven’t tested this extensively but it seems to work fine under Wordpress 2.0. I have no plans of testing it in Wordpress 1.5 so please don’t bother me if it doesn’t work there. After all, it’s easier for all of us to simply upgrade to 2.0.
Thanks! Post your comments and bug reports below.
October 18th, 2006 at 10:08 am
nice, I’ll try to test it later. I havent tried creating my own plugin but i wanted to. hehe maybe if i’ll have more time, yeah that’s after school. Anyway, kudos to you for this uber nice plugin..
October 30th, 2006 at 11:38 pm
Thanks from Barcelona, Spain
November 26th, 2006 at 9:01 pm
Thank you from Japan;)
January 22nd, 2007 at 6:39 am
I want to congratulate you for creating this plugin. I was looking for something like this for my Wordpress 2.0 install as I just wanted to include a different template for each of my niche categories. I did loads of searches looking for the solution and just as I was about to give up on ever actually being able to achieve this - without having to write or change loads of code - I eventually came across your blog with your plugin. Thankfully, it worked great, it was simple and straightforward to install. Well done and keep up the good work and thanks again
April 3rd, 2007 at 4:42 am
Has anyone had any success with this plugin under WP 2.1? It’s not working for me…
July 2nd, 2007 at 1:25 pm
I just tried to use it on 2.2.1 and I don’t get a select theme dropdown in the Edit Category menu.
August 14th, 2007 at 8:08 am
It was working fine until today, all in sudden my site got offline due to this plugin. There’s definitely a problem with WP 2.x series when WordPress automatically tries to save posts, this plugin conflicts with it, and causing the site to down.
Perhaps shutting down auto save on 2.x series would work well.
August 28th, 2007 at 4:45 am
Mike,
Great template, but I was hoping you could give me a hand. I’m trying to set up the template for some of the niche sites I’m working on, but for some reason I can’t get the adsense to display properly on my home page.
It comes up correctly on the other pages that I’ve created on the subdomain, but on the main page I only get adsense related to blogging tools, wordpress, and various templates. On this particular one I’m trying to come up with car insurance related ads, but it isn’t happening.
Any suggestions on how I can address this?
August 29th, 2007 at 10:41 am
Hi Jim McMenamin,
I experienced that before. Just wait for Google to properly index your site. In my previous experience, it took I think almost 10 days before the right ads started showing up. For now, just keep on updating your site with content.
Mike
September 11th, 2007 at 2:54 am
ive been looking for somehting like this, my php is weak so this really has helped me out! thanks.
October 11th, 2007 at 4:50 am
Oups !!! i have an error msg :
Erreur de la base de données de WordPress : [Table ‘discussi_blogddg.wp_themed_categories’ doesn’t exist]
SELECT cat_theme FROM wp_themed_categories WHERE cat_ID = 9;
October 14th, 2007 at 7:08 am
try disabling then re-enabling the plugin. also what version of wordpress are you using?
October 25th, 2007 at 7:04 pm
Cool, will definitely try it out. Thx
November 1st, 2007 at 4:08 pm
Hi! So does this work in 2.3 or 2.3.1??? Has it been updated recently?
~G
November 1st, 2007 at 5:04 pm
haven’t tried it yet.
November 6th, 2007 at 10:44 pm
Great plugin, searched a long time to find it …..
but….
it does not work with wp 2.3 and 2.3.1
The install is no problem
The dropdown menu is ok, and i can choose a theme also….
But the selected theme does not shows up in the selected category….
I (we) will appriciate an update!
Thanks in advance and keep it up!
November 19th, 2007 at 5:21 am
Great work, thanks.
I run WP 2.3 on a Blog I administrate. There I had to patch Your plugin a little to work.
I appended the “ignore case option” for the categories page the regexp to look like this: “operatestr = operatestr.replace (//i, substitute+”");”. Then the DB structure changed a bit. Don’t know it exactly but a first look brought me to the following SQL for the function tc_template_redirect in the is_single block: “$cat_id = $wpdb->get_var (”select {$table_prefix}term_taxonomy.term_taxonomy_id from {$table_prefix}term_taxonomy, {$table_prefix}term_relationships where {$table_prefix}term_taxonomy.term_taxonomy_id = {$table_prefix}term_relationships.term_taxonomy_id and {$table_prefix}term_taxonomy.taxonomy = ‘category’ and {$table_prefix}term_relationships.object_id = {$wp_query->post->ID} LIMIT 1″);”. This works for me now. If You have any suggestions please let me know. Every comment is welcome! You may want to download my little changes from http://www.gschmarri.org/wp-content/uploads/plugins/themed-categories-23.zip for a while.
cu
Kalle
November 19th, 2007 at 6:07 am
Ups? Where has gone my comment?
Wanted to point out one more thing. is_category changed also in WP2.3 I think. So I had to replace “$cat_id = $wp_query->post->category_id;” with “{ $cat = get_the_category(); $cat = $cat[0]; $cat_id = $cat->cat_ID; }”.
December 2nd, 2007 at 1:56 pm
great great great! anyone been able to resolve the issue of the changed category theme not carrying over when looking at individual posts in the category
January 15th, 2008 at 8:51 pm
same question s noirlecroi’s last post, anyone figure out how to keep post pages in category to same theme as category theme?
January 22nd, 2008 at 2:43 pm
Would LOVE a published update of this theme! Thank you so much.
February 20th, 2008 at 2:23 am
Oups !!! i have an error msg :
WordPress database error: [Table ‘pithecanpodpus.wp_themed_categories’ doesn’t exist]
SELECT cat_theme FROM wp_themed_categories WHERE cat_ID = 3;
March 16th, 2008 at 3:32 pm
Hello to all… Please download the latest version of this plugin now. I fixed the bugs and it should now work with the latest versions of Wordpress. Sorry for the long delay, I got really busy. Cheers!
March 25th, 2008 at 8:38 am
Hi,
your Themed Categories Plugin is great for me…
I can apply different themes to different CATEGORIES… ok is simple and nice…
but i would ask you if was possible to have a plugin for apply different themes to different PAGES…
March 25th, 2008 at 8:49 am
Hi Thanks for giving it a try. As for different themes for pages, I’m sorry but I don’t have such a plugin.
April 7th, 2008 at 11:14 pm
cool! thanks a lot! u made my day
nils
April 10th, 2008 at 10:37 am
Hi,
Can anyone confirm if the latest version works with WP 2.5? Thanks!
April 10th, 2008 at 3:53 pm
Hi,
Just tested it with Wp 2.5 and it works fine. The theme selection dropdown appears when I edit a category.
Mike
April 10th, 2008 at 9:29 pm
Hi,
I can also see the theme selection dropdown here. However, the changes are not saved (after I select a theme and click edit category), because the plugin does not seem to have any effect?
April 11th, 2008 at 1:59 am
Hi Louis,
To test the plugin, I installed Wordpress 2.5 here:
http://mikelopez.info/wp25/
And created two posts - each on a different category.
Unthemed: http://mikelopez.info/wp25/?p=1
Themed: http://mikelopez.info/wp25/?p=3
The categories are at:
Unthemed: http://mikelopez.info/wp25/?cat=1
Themed: http://mikelopez.info/wp25/?cat=3
Seems to be working fine. Cheers!
April 13th, 2008 at 8:47 am
Hi I ve just tried this plugin but I can’t find the “Select category themed” dropdown tag? Where is it? I am using WP 2.5 …
April 13th, 2008 at 2:21 pm
Hi,
It only shows when you “edit” a category and not when you “add” a category.
Mike
April 14th, 2008 at 1:27 pm
Hi,
Thanks. On a hunch, I tried out the plugin on another WP2.5 installation and this time the plugin does exactly what it is supposed to do! So I think the problem must be to do with this particular instance of WP2.5 and perhaps incompatibilities with other plugins? Anyway I will try to get to the bottom of this . Thanks again, and an excellent plugin, if I can get it to work on the original domain I was asking about.
April 14th, 2008 at 5:34 pm
Hi again,
It turns out the table themed_categories (defined in tc_install) were never created for some reason in my case. After manually creating the table using phpmyadmin, everything is working fine now.
April 16th, 2008 at 4:16 am
Hey all,
I love the plugin, but I’m running into one problem.
I, like a lot of people, use Feedburner for syndication. When Themed Categories is activated, the Feedburner feed returns a 500 error stating the server redirected too many times.
Has anyone else run into this, and if so how did you fix it.
WP2.5, by the way.
Love the plugin; I just wish I could use it.
April 18th, 2008 at 5:59 am
Follow up:
I’m finding the plug-in is killing my rss feed altogether, ignoring Feedburner.
Any help would be appreciated.
April 24th, 2008 at 12:31 am
Hi, again.
Just wondering if anyone (or perhaps Mike since he knows the plugin better than all of us) has seen the 500 redirect error and has found a way to work around it.
I’m finding the error isn’t just feed related — it’s a general 500 error that prevents even things like posts in a themed category from being dugg.
Thanks!
April 24th, 2008 at 2:06 am
Hi Chris,
Thanks for reporting the problem. There was some old code in the plugin causing the redirect - back then, it was the only way I know to make the plugin work but experience change people often times making us better.
To make the long story short, I’ve fixed the bug and updated the plugin. You can download the latest version now and see if it works on your end.
Mike
April 27th, 2008 at 7:42 pm
This will be a replacement of WPMU to seperate the content however there is a plugin out there that has not been updated. It would be based on single file to modify different template instead theme. Is it possible for you to have another plugin for template based on category instead I have to copy the whole theme and redesign one page of header to make it look differently. I just dont want the different theme but template, yes…
May 6th, 2008 at 12:32 am
Hi Mike… interesting plugin you got there.
Is there a plugin that allows me to choose what to display on the sidebar, for both pages and posts? Like say, for posts I want to show only recent posts or other posts on the sidebar, but on a page, I want to display just categories and no recent posts.
Thanks,
Roy
May 6th, 2008 at 1:39 pm
Thanks Roy. As for what you want, I don’t know of any such plugin yet but that sounds interesting.
Mike
May 14th, 2008 at 11:53 am
Well you guys…if you wonder if the plugin works for WP2.5. It really does. I installed it and use it on my website. But its not actually what I looked for - I was searching for a plugin that can change the header per category. For now I will use it. This plugin rocks - I love it. Thanx man - thumbs up from south-america.
May 29th, 2008 at 2:54 am
thanks.
May 30th, 2008 at 2:15 am
I installed this plugin on one of my blogs — 1459pm.com and none of the pages would load. It would just sit there an spin. Anyone else see this issue before? WP 2.5.1.
June 4th, 2008 at 6:18 pm
Hi Mike,
I have just installed your plugin on Wordpress 2.5 but the dropdown is not appearing.
I have done some checking and the problem seems to be the following javascript error on the edit category page:-
error: ‘document.forms[0].tc_cat_theme.options’ is null or not an object.
June 4th, 2008 at 6:20 pm
Hi Mike,
I have just installed your plugin on Wordpress 2.5 but the dropdown is not appearing.
I have done some checking and the problem seems to be the following javascript error on the edit category page:-
error: ‘document.forms[0].tc_cat_theme.options’ is null or not an object.
Any advice would be greatly appreciated.
Best regards,
Michael
June 4th, 2008 at 9:41 pm
Hi again Mike,
Some of my comment went missing when I submitted it.
The full error was:-
message: Statement on line 15: Could not convert undefined or null to object document.forms[0].tc_cat_theme.options[0] = new Option(” (global)”, ” (none)”);
Hope this submits ok.
Best regards,
Michael
June 25th, 2008 at 5:58 am
awesome plugin thank you