Template – Frequently Asked Questions

A number of people have asked for some detailed explanations of how to customize their category templates using Idealien Category Enhancements within their WordPress installation.

Over the next few weeks I’ll be putting out a series of 5-minute videos walking through the installation and template design process for different category styles. First up is one that everyone is probably familiar with – frequently asked questions. Code sample and step-by-step instructions are included below the video.

Direct Video Link:http://www.screencast.com/t/RrGumx6HhdY

Step-By-Step Instructions

  1. Download Idealien Category Enhancements from WordPress.org Plugin Directory.
  2. Upload the contents of the .zip to your wp-content/plugins folder.
  3. Activate the plugin.
  4. Copy a page.php file or any other existing template file from your current theme and save it as category_faq.php.  (or whatever matches the category template prefix you define in the Settings > Idealien Cats menu. The rest of these instructions assume you are using category_ as the prefix).
  5. Go to the Posts > Categories menu to add / edit a category. At the bottom of the form make sure to select faq from the Template drop-down.
  6. Go to the Settings > Idealien Cats menu and copy the php comments at the top of the menu into your category_faq.php file, changing the appropriate fields. When you refresh the posts > categories menu it will now have the file title / description from the comments area.
    Note: This does not affect the database table which stores entries based on the actual category template filename.
  7. Modify your template file to use the two loops provided in the example code area below. The first one uses an unordered list of href links to show just the title. The second one has headings with anchor links followed by the post content for each post.

Example Code

Insert this code into your category_faq.php file within whatever standard xhtml / css markup is used to generate your primary content area.

<ul>
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		<li>
			<a href="#post-<?php echo $post->ID; ?>" title="<?php the_title(); ?>">
				<?php the_title(); ?>
			</a>
		</li>
	<?php endwhile; endif; ?>
</ul>
 
 
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<h3><?php permalink_anchor('id'); ?><?php the_title(); ?></h3>
	<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
<?php endwhile; endif; ?>
This entry was posted in ICE. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

12 Comments

  1. Robert
    Posted October 29, 2009 at 9:01 am | Permalink

    I’ve installed ICE and followed the instructions in your video to set up a template, but the template does not appear in the Post Categories dropdown box. Any suggestions?

  2. Robert
    Posted October 29, 2009 at 9:27 am | Permalink

    I found the problem. I’d put the template in the wrong theme. Everything is working beautifully. Thanks for the plug-in!

  3. Posted November 28, 2009 at 2:44 am | Permalink

    does this also provide flexibility for choosing to include side bar widgets or creating full pages?

    • Posted November 28, 2009 at 6:18 pm | Permalink

      The methods that standard category templates can use to include sidebar widgets are respected through this plugin. It does not have anything to do with pages though.

  4. Posted December 16, 2009 at 10:43 am | Permalink

    the newly create category (in my case Category_sales) doesn´t pick up the salessingle.php.

    I want to create a series of landing pages (posts) that use another theme (a simple one without the sidebars, footers ect). I copied the single.php file from that theme (has more files like .css, index, etc), renamed it to singlesales.php and copied it to the standard theme directory where also the single.php file is.

    In the new category (sales) I selected the singlesales.php theme, but when generating a new post in that category it still seems to pick the single.php (as I don´t see any changes in the resulting post layout ). Do I have to copy other files (like style.css, or index files and rename these as well)……??????

    Any idea how to do this?

  5. Posted January 4, 2010 at 3:19 pm | Permalink

    @her – From your description, I’d recommend you watch the video from this post which covers the steps you’re missing. You need to have a modified category selected through the posts > category menu applied to your category in order for a specific post template to take effect.

    If you want non-category based post customization, you might want to try Nathan Rice’s Single Post Template Plugin.

  6. Maxmyd
    Posted January 28, 2010 at 4:50 pm | Permalink

    Hi.
    I have created custom template for certain category. When I step into that category, I can see changes there. But posts from that category on home page still look the same as other posts. Is that possible for those posts on main page also to have a custom look?
    Thank you

    • Posted March 5, 2010 at 6:14 pm | Permalink

      No – for that you would have to modify the presentation in either home.php, index.php or the specific page template you have assigned to your home page within WordPress.

  7. Posted July 9, 2010 at 11:36 am | Permalink

    Awesome plugin! Working great, except for one little (and slightly annoying) glitch. :(

    The plugin works wonderfully when I select a template while creating a new category, but doesn’t if I go into the “Edit” page of a pre-existing category. It allows me to select the template from the drop-down menu, but when I click save it doesn’t save it. This has lead me to having to re-create any of the categories I already had (including sub-categories) in order to get the templates to apply.

    Any suggestions on how to fix this?

    • Posted July 12, 2010 at 9:21 am | Permalink

      Thanks for the praise Sarah. Need more info to be able to offer any help to resolve your issue:

      • What version of WP do you have it installed on? It works with 2.9.2 and below currently with no issues.
      • Have you tried it (temporarily) with all other plugins turned off?
      • What (if any) other plugins do you have installed that relate to categories or themes or templates?
  8. Alex
    Posted July 18, 2010 at 12:47 am | Permalink

    Hey, I would like to obtain something similar to what you have here: http://idealienstudios.com/projects/ice/
    I don’t know if this is a category page, but what I need for my blog is to have a different explanatory text for to each category archive of my blog. Here you have the short text at the beginning ” Idealien Category Enhancements…” styled the same as the posts that follow it. Maybe this is not done with your plugin, but I’d appreciate a reply.
    Thanks a lot.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">