Skip to Content

5 Ways To Include Template Files In WordPress

Submitted by rilwis on June 30, 2010 Website: www.deluxeblogtips.com

As long as you work with WordPress, you'll realize that some code is repeated itself many times, like the loop. The new Twenty Ten theme in WordPress 3.0 has put loop code in into a loop.php file to make it separated, and when it's needed, just include it into theme file. Why don't we follow that? Seperating a repeatitive code into a file is a good way to organize and manage code. It keeps our code cleaner, easier to read. All these files can be put in a current theme folder or subfolder to make a good structure. This is a very popular principle in software development: Don't Repeat Yourself (DRY) or Duplication is Evil (DIE). In WordPress, there are several ways to include a template file into current file, that we'll consider in this article.

Voted by:
Binary Moon@devinsaysHeshammtraistarilwispaluriemocoangiebowenigeekeeuebeliklannewsknarfskiminvasionaroderomamun2336tnsblogbofthew

No Responses to “5 Ways To Include Template Files In WordPress” Leave a reply ›

Leave a Reply

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>

What is WPVote?

WPVote is a place for people to find and vote on the best WordPress content online.

People can create free accounts, and then submit articles and vote for their favourites so that the cream rise to the top. WPVote is about sharing, so feel free to submit and vote upon your articles and those of your friends.

Read More on the About WPVote page