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.

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

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="">

  • Help me help you!

    Name: (required)

    Email: (required)

    How can I help?

    Details:

  • What is an Idealien?

    The word Idealien originates from the word "idea" or "ideal" and conveys my principle philosophies of business:
    • I will always strive to build the ideal solution for my clients - if they aren't happy, I'm not.
    • I am always interested in new ideas or ways to solve a challenge more efficiently.

    Pronounced like chameleon
    the more you say it,
    the better it sounds!

    Since building my brand around this concept it has amazed me how many times I hear people say, "The ideal thing to do would be..." and then pick a different course of action. An Idealien solution is one that is:
    1. Cost-effective
    2. Easy to use and maintain
    3. Helps you meet your business goals
    4. Can scale as your business grows
    5. Engages your customers
    When you combine that with the word alien, in reference to the little blue alien which is the base of my branding, you get Idealien!