Category Templates Plugin

The Category Templates plugin for WordPress is a great for adding custom templates to your posts and archives based on the its Category.   The user interface is straight forward and easy to use.

To use the Category Templates plugin, you create either a post template or an archive template.  I use it for post templates.  I base my post templates off of my index.php file.  It is necessary to add a couple of lines of code your your newly created post template or archive template files for this plugin to work.

In your Post Template file add the following lines of code at the beginning of the file:

In your Archive Template file add the following lines of code at the beginning of the file:

If you are running WordPress 2.9 or newer you may receive the following error message when you go into the plugin:

Warning: file(C:\wamp\www\wordpress/wp-contentC:\wamp\www\wordpress/wp-content/themes/your-theme/404.php) [function.file]: failed to open stream: Invalid argument in C:\wamp\www\wordpress\wp-content\plugins\category-templates\cat-templates.php on line 153

Warning: implode() [function.implode]: Invalid arguments passed in C:\wamp\www\wordpress\wp-content\plugins\category-templates\cat-templates.php on line 153

To correct the error, edit the plugin.  Go to line 153.

Change:

$template_data = implode(”, file( WP_CONTENT_DIR.$template));

To:

$template_data = implode(”, file( $template));

6 comments for “Category Templates Plugin

  1. me
    September 14, 2010 at 3:25 pm

    Hot dog! It worked!

    Thanks!!!!

  2. Mell
    January 19, 2011 at 1:11 am

    Thanks a lot for the fix!

  3. May 8, 2011 at 9:15 pm

    It works! Thank you so much!

  4. bhaguart
    June 29, 2011 at 11:29 am

    Thank you. Plugin should be updated…. i was lost without you. Thanks again.

  5. April 14, 2012 at 11:44 am

    Is there a sample site that has this…i think this is what i am looking for…???

    • April 17, 2012 at 5:05 pm

      Sorry I don’t. I no longer use the plugin.

Leave a Reply to victoria Cancel reply

Your email address will not be published. Required fields are marked *

*

Subscribe without commenting