Before learning, “What is a wordpress theme”, you are suggested to go through below articles.
A WordPress theme is like an outer visible Skin, that your website has. A wordpress theme is actually made up of number of php templates and a style sheet file. Those PHP Templates and CSS file, together produce an outer appearance called “skin” here, to your website. A theme is a folder, made up of templates and each template performs some piece of work for the theme.
PHP Template files are files with .php extension and a style sheet file is a file with .CSS extension.
Some themes are freely available, and some other themes may cost you to offer a few bucks to its Author.
SOME COMMON TEMPLATES THAT RESIDES IN A THEME:
HOW THESE TEMPLATES APPEAR ON A WEB?
Theme Anatomy Cheetsheet: A WordPress theme structure:
Learning the function of Each Template:
- 1. HEADER.PHP :- It is a more generic file , can be called Global file . It displays headers and navigation. It contains some HTML Code.
- 2. SIDEBAR.PHP:- It is used for displaying widgets .Multiple sidebars can be set up using function.php. Contents of sidebar are controlled from admin panel-> widgets. (function.php is explained in later part of the post)
- 3. FOOTER.PHP:- It is a Global file and closes all HTML tag.
It shows main area of your web. This main area is controlled by following individual files.
- INDEX.PHP :- It controls the Homepage. It contains a loop that queries and then display the recent blog post excerpt (You may display whole content).You can select a Page, to display on the Homepage.
- SINGLE.PHP- When you click on any post on techriff home page , you are redirected to another webpage to display the whole content. The display of such individual post is controlled by single.php.
You may omit your sidebars here. We will cover “How to omit a sidebar” in another blog post.
- PAGE.PHP- It controls the static pages in wordpress. Go to About Us section on techriff. Compare it with Homepage of techriff and know the differences. You can eliminate sidebar option in page.php template. WordPress allows you to create different page template for different page.
- 1. Archieve.php : Display tag , category , author based or data based.
- 2. Search.php : Display a list of post in excerpt or full length form.
- 3. Comments.php: Display Avatars , threaded comments , pingbacks.
UNDERSTAND LOOP WELL:
Loop is the most powerful part of WordPress. It starts with a query and executes the loop till endwhile statement. You can put anything that you want to execute in between the block. Post title, post contents, commenting, Meta data, custom fields etc inside the block.
SOME OTHER IMPORTANT TEMPLATES:
There are some other files run at background. These files can be modified to give a custom look and function ability to your theme.
FUNCTION.PHP: You can put your own PHP code to modify certain elements in your theme. Mostly used for creating sidebars.
STYLE.CSS: This sheet is used to stylize the “skin” of your theme. It is also editable to bring a custom look to your web. At the beginning of the style sheet , you will find the information regarding your theme name , author name , description of theme etc.
Apart from above templates, Plugins, Custom fields and widgets allow you further customization.
Feel free to share if you like the Post.
Latest posts by TechRiff (see all)
- Finally GitHub has a self-paced training course in its List - 3 November, 2015
- Back Up WhatsApp Messages, Photos And Videos To Google Drive - 9 October, 2015
- How to Disable Auto Play in Facebook - 30 September, 2015