learn wordpress theme

LEARN WHAT IS A WORDPRESS THEME

Before learning, “What is a wordpress theme”, you are suggested to go through below articles.

  1. What is WordPress?
  2. How to Install wordpress?

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:

  1. Header.php
  2. Sidebar.php
  3. Footer.php

Loop files

1)      Index.php

2)      Archieve.php

3)      Page.php

4)      Single.php

5)      Comments.php

6)      Search.php    

HOW THESE TEMPLATES APPEAR ON A WEB?

 showing header , footer , sidebr and loop

Theme Anatomy Cheetsheet: A WordPress theme structure:

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.

LOOP FILES:

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.

INDEX.PHP

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

single.php

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

PAGE.PHP

 

 

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

What is a loop in wordpress?

 

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.

1.Function.php

2.Style.css

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. :)

 

The following two tabs change content below.
A Stinky Gadget lover . Keep my Eyeballs ON , on each small happenings occurring in TechWorld. A Passionate learner , to grasp the latest development done in Gadgets and techworld.

Leave a Reply