Oct 2006
17
05:02am


» Follow me on Twitter

UPDATE!!! Please use GYS Themed Categories 2.0 instead of this one. It does the same job, written by the same guy (myself) but this time it works.

Download GYS Themed Categories 2.0 Now!

Note: I’ll be keeping the old (non-working) for those with older Wordpress versions.

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.


» Follow me on Twitter


73 Responses to “Wordpress Themed Categories Plugin”

  1. jong Says:

    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..

  2. Ruben Says:

    Thanks from Barcelona, Spain :)

  3. MIHO Says:

    Thank you from Japan;)

  4. Eleesha Says:

    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 :-)

  5. Matt Says:

    Has anyone had any success with this plugin under WP 2.1? It’s not working for me…

  6. David Petersen Says:

    I just tried to use it on 2.2.1 and I don’t get a select theme dropdown in the Edit Category menu.

  7. Takuya Says:

    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.

  8. Jim McMenamin Says:

    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?

  9. The Blogger Says:

    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

  10. lordbarron Says:

    ive been looking for somehting like this, my php is weak so this really has helped me out! thanks.

  11. dreamer Says:

    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;

  12. The Blogger Says:

    try disabling then re-enabling the plugin. also what version of wordpress are you using?

  13. Malta Says:

    Cool, will definitely try it out. Thx :)

  14. Griffin Says:

    Hi! So does this work in 2.3 or 2.3.1??? Has it been updated recently?

    ~G

  15. The Blogger Says:

    haven’t tried it yet. :(

  16. Margje Says:

    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!

  17. Kalle Says:

    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

  18. Kalle Says:

    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; }”.

  19. noirlecroi Says:

    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

  20. sam Says:

    same question s noirlecroi’s last post, anyone figure out how to keep post pages in category to same theme as category theme?

  21. Kevin Says:

    Would LOVE a published update of this theme! Thank you so much.

  22. kapaeru Says:

    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;

  23. The Blogger Says:

    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!

  24. Hans Says:

    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…

  25. The Blogger Says:

    Hi Thanks for giving it a try. As for different themes for pages, I’m sorry but I don’t have such a plugin.

  26. nils Says:

    cool! thanks a lot! u made my day :)
    nils

  27. Louis Says:

    Hi,
    Can anyone confirm if the latest version works with WP 2.5? Thanks!

  28. The Blogger Says:

    Hi,

    Just tested it with Wp 2.5 and it works fine. The theme selection dropdown appears when I edit a category.

    Mike

  29. Louis Says:

    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?

  30. The Blogger Says:

    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!

  31. Colorfulmars Says:

    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 …

  32. Mike Lopez Says:

    Hi,

    It only shows when you “edit” a category and not when you “add” a category.

    Mike

  33. Louis Says:

    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.

  34. Louis Says:

    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.

  35. Chris Says:

    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. :)

  36. Chris Says:

    Follow up:

    I’m finding the plug-in is killing my rss feed altogether, ignoring Feedburner.

    Any help would be appreciated.

  37. Chris Says:

    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!

  38. Mike Lopez Says:

    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

  39. Jed Says:

    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…

  40. Roy Sencio Says:

    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

  41. Mike Lopez Says:

    Thanks Roy. As for what you want, I don’t know of any such plugin yet but that sounds interesting.

    Mike

  42. Blond Says:

    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.

  43. jocuri Says:

    thanks.

  44. srcasm Says:

    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.

  45. Mike Says:

    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.

  46. Michael Says:

    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

  47. Mike Says:

    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

  48. televiziune online Says:

    awesome plugin thank you

  49. Bernardo Pereira Says:

    Hello, Mike!
    Your plugin was just what I was looking for!
    I’ve downloaded it and inslalled (version 1.2), but it didn’t work..
    I’ve edited the desired category and chose the appropriate theme for it, but nothing happened when I opened it…
    When I tried editing it again, to see if I did something wrong, I noticed that the selected category was “global”…
    It doesn’t matter how many times I try, it always goes back to “global”.
    I’m using wordpress 2.5, running on my computer.
    Could you please help me??
    Thank you very much!!!!

  50. Mike Lopez Says:

    Hi Bernardo,

    Does the plugin or PHP show any error?

    Mike

  51. Bernardo Pereira Says:

    Hello, Mike!

    the error log says:
    WordPress database error Tabela ‘tzdz.wp_themed_categories’ doesn’t exist for query SELECT cat_theme FROM wp_themed_categories WHERE cat_ID = 6; made by tc_set_template

    I’ve tried to re-install wordpress, re-install the plugin, but the error keeps happening.
    Is it possible to configure the tables manually?
    Apparently the tables weren’t created when I installed the plugin, for some unknown reason…

    thank you very much!
    Benardo

  52. Bernardo Pereira Says:

    I’ve managed to solve the problem!
    I’ve commented the lines about checking “user level” on the plugin file, re-installed it and now the tables were created and the plugin is working fine!!!

    thank you very much!!!! : )

  53. Mike Lopez Says:

    Hi,

    Nice to know you got it working. :)

    Mike

  54. Ryan Says:

    Hi there, installed the plugin successfully on Wordpress 2.6 but there is no dropdown appearing, and no error message. Can you help?

  55. Ed Says:

    This plugin is exactly what I am looking for, but it does not seem to work with Wordpress 2.6. Any chance this will be fixed in the near future?

  56. Paul Says:

    Hi

    This plugin is a lifesaver for me, but I cannot get the drop down menu to show in the admin area.

    The table has been created in the DB with zero rows, and if I view source, the script of inner html is shown at the bottom, after the admin footer.

    This is of such importance for me I’d be happy to sponsor the tweaking of it to wrok with wp 2.6.

    Are you still developing this plugin?

  57. Philo Kezzar Says:

    Hi Mike,
    I love yr plugin and work perfectly but Page are not working (404 error) anymore with “wp-magazine” theme.
    Could you please find out the problem why?
    I’m dying to use yr plugin with that theme.

    Thanks in advance

  58. Mike Lopez Says:

    Hi Paul,

    I only have very little time in my hands at the moment to fix the bugs. Feel free to tweak it so that it works with Wordpress 2.6

    Thanks!

    Mike

  59. Pim Odekerken Says:

    Hi there,

    I used this plug-in in older version of wordpress. Sadly it isn’t wotking in 2.6.. I already read I’m not the only one. Can we expect an update soon? Or is there an alternative?

    Thanks a lot for any help.

    - Pim

  60. Mike Lopez Says:

    Hi Pim,

    Sorry, haven’t found the time to fix it yet but I will try to do so this weekend. Sorry.

    Mike

  61. Pim Odekerken Says:

    No problem ;) But it’s just a very good plugin :)

  62. Pim Odekerken Says:

    Hi again,

    Maybe I’m doing something else wrong. I have installed WP 2.5 and it isn’t working either but it should according to your post. When I hit “Edit Category” I het the message “category saved” but when I go back into the category edit the theme is not there anymore… Any idea?

  63. Jed Barish Says:

    It will be great to see it worked for WP 2.6.1 however it caused a hang up on server when we tried to access a category for diff theme. It basically froze the server a bit. Any idea?

  64. Henry Says:

    Hi, any luck with fix for 2.6 ?

  65. Peejay Says:

    any updates? :D

  66. Jack Says:

    Great plugin. Works fine for me on 2.6

    However, is this situation possible?

    I have categories that I want different themes for. For each particular theme I want that particular subcategory to only show the subcategories, and not all of them?

  67. jc Says:

    anyone found a fix for this plugin yet>

  68. DJ Says:

    I can’t get this plugin to work properly. The drop down menu doesn’t show up in IE at all when I’m editing the category. The drop down menu does show in Firefox, but when I save the changes after selecting a theme it doesn’t actually save the changes. Is anyone else experiencing the same issue. BTW I’m using WP 2.6.2

  69. john Says:

    It doesn’t work. The drop down menu doesn’t appear in IE or Opera. it shows in firefox but as soon as i assign themes for the categories everything stops working until i delete the plugin

  70. Mike Lopez Says:

    To all those who gave Wordpress Themed Categories a try and ended up being disappointed, I have a good news. I rewrote the plugin and it now works perfectly in Wordpress 2.6. There is however a caveat, I wasn’t able to test it on lower versions.

    The new plugin is called GYS Themed Categories 2.0. I placed it on my new “downloads” blog. Get it at http://get-your-stuff.com/gys-themed-categories-20.html

    Just Wordpress Themed Categories and replaced it with GYS Themed Categories 2.0.

    Cheers!

  71. kralksk Says:

    wordpress 2.7 not worked :(

  72. Jason Says:

    works great on 2.7.1 !

  73. Jeevan Says:

    http://www.casualgenius.com has a plug-in for subdomains and the themes.

    I am on the hunt for a solution to get the sub-categories working on sub-domains. It currently shows up as a 404 page.

Leave a Reply