Top 25 PHP template engines

January 30, 2009

After searching the Internet for a good template engine, I have compiled the following list: Smarty Smarty is a template engine that compiles the templates into PHP scripts, then executes those scripts. Very fast, very flexible. Heyes Template Class A very easy to use, yet powerful and quick template engine that enables you to separate your page layout and design from your code. FastTemplate A simple variable interpolation template class that parses your templates for variables and spits out HTML with their values ShellPage A... [Read the full story]

Create a wordpress 2.7 compatible comments template

November 20, 2008

WordPress 2.7 includes a lot of new enhancements, but one of the big ones is the new comment functionality. Comments can be threaded, paged, etc. This is all built in, but unfortunately, your theme must support it. So, for theme authors, I’d suggest getting to work on making your themes compatible right away. How to create a wordpress 2.7 compatible comments.php If you want your theme to be backward compatible as well, then there’s a simple way to do it. Just check for the wp_list_comments function, like so: if (function_exists('wp_list_comments'))... [Read the full story]

Make your comments template compatible with WordPress 2.7 and older versions

November 11, 2008

You’ll need two file: The first one is a WordPress 2.7 compatible comments file, named comments.php. The second one is a comment template for older WordPress versions, named legacy.comments.php in this exemple. Paste this elegant code in your theme functions.php file. Create this file if it do not exists yet. If the wp_list_comments() function doesn’t exists, the code will automatically load legacy.comments.php instead of comments.php. <?php add_filter('comments_template', 'legacy_comments'); function legacy_comments($file)... [Read the full story]

Use different single template per wordpress category

November 11, 2008

Why a blog must always have the same layout? I’m going to tell you how you can define differents post layouts for each of your categories. First, you’ll have to create each different layouts you’d like to use. They’re named single1.php and single2.php. The default posts template is single_default.php. Once you have your templates ready, insert the following code on your regular single.php file. When single.php will be called, this code will automatically include your custom layout based on the current category id. <?php ... [Read the full story]