Learn WordPress
Home » Programming

WordPress Themes File Structure

WordPress Themes File Structure

How wordpress theme work? Why and how easily change the theme of wordpress just by simply click on Design > themes? pusing

WordPress is a CMS (Content Management System), which were prepared using language PHP. So now you try to go into wordpress directory on your local computer, and open the file index.php.

index.php is a file opened when the browser pointed to a directory without writing the file address. example: write the address in the browser means http://localhost/example open index file (if any) on that directory: http://localhost/example/index.php

when you access an address wordpress blog, which made these blogs (the main index.php file) is checked Theme being used by these blogs, then displaying blog content from the database using the “framework” and a design theme that was used these.

therefore, so you we can easily change the theme in wordpress. replace the current theme = “skeleton” and a design that is used to change = the blog changed.

Now, what is WordPress Themes? swt2
WordPress Themes standard, consists of three types of files:

  1. One file .png that will display a screenshot of the theme in the Design > Themes.
  2. File .css that will define the design and gives the “skeleton” the php file.
  3. File .php which uses a specific file name is the standard wordpress theme file that will be the “skeleton” of the blog, and files.

The name of the main file on the structure of WordPress themes need to follow existing standards. So the existing file name should follow the established rules for wordpress to “read” and used by wordpress system. Name of the files are (Only the file – the main file is important and is used in general):

  1. screenshot.png: File size image (generally) 300 X 225 pixels. to display the screenshot on your WordPress Dashboard in the Design > Themes.
  2. style.css: css file that serves to define the “skeleton” php file. Css file is also in charge of storing information on themes such as theme name, code versions, address the theme maker, theme maker, theme description, etc to use tags that have been standardized by wordpress.
  3. index.php: the main file of a theme. file to define the appearance of blogs in general, which is useful as a last alternative. full explanation is below.
  4. home.php: This file defines the main blog (view home).
  5. page.php: This file defines what will be displayed on the “page page”. pages are static pages of wordpress blog. For example, in aming.info, page is About Aming. (Published in the menu above).
  6. single.php: This file defines what will be displayed on the “post page”. post page is a page that displays your posts in full, complete with the comments. sample post page is the page you are reading this middle.
  7. comment.php: file define the “skeleton” of the comment and form to submit comments.
  8. search.php: file define what will be displayed on search results pages.
  9. archive.php: file define what it must be displayed on the category pages, tag and archive.
  10. 404.php: file that defines what will be displayed on a page that does not exist / error page.
  11. functions.php: files that are used to define the function of certain wordpress.
  12. header.php: file to define the data – data in the header, and then used jointly by each file. point? header for each file ensure uniform.
  13. footer.php: file to define the footer. same as the header.

WordPress Themes File Structure

WordPress theme system has a certain hierarchy. for example, if the page.php file does not exist on the theme, wordpress will automatically use the index.php file to define the page display. This is full hierarchy.

Therefore, the actual theme still be able to run even if only contains the files index.php and style.css only. Actually there are files to define the other pages in order to look more customized. but because it is rarely used. hmm

FREE Cloud Storage