Code for the 2012 WordPress Theme

In this group of posts you can see some of the WordPress code. WordPress is open source, so it is ok to have a look! This is some of the code from the theme Twenty Twelve.

If you are a website developer and you want to customize your theme, being comfortable with some of the code in these templates will be necessary. The Codex has the following to say about template files:

Templates are the files which control how your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser. Through its powerful Theme system, WordPress allows you to define as few or as many Templates as you like all under one Theme.

Your website content is stored on the web server in one of two ways: in the database or as files in folders. Your layout and styling (fonts and colours and so on) are stored as text files on the server. They are php files, html files, xml files and css files. When the viewer of your web site opens your page, the server transfers HTML, CSS and Graphic files to their web browser and the browser processes these file and presents them to the user in a web page.

Check out the article Stepping Into Templates for more information on templates. Here is how that article starts:

Template files are the building blocks of your WordPress site. They fit together like the pieces of a puzzle to generate the web pages on your site. Some templates (the header and footer template files for example) are used on all the web pages, while others are used only under specific conditions.

Leave a comment

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