What is a WordPress theme?

152 views
What is a WordPress theme?

What is a WordPress theme? Is a set of CSS, js, PHP files that, in conjunction with WordPress and plugins, display information from the database on the screen in a beautiful and convenient form (design) or in an ugly and uncomfortable way. A theme is also called a “template”, but in WordPress, it is usually called “theme” and not “template” even though both words mean the same.

Thus, if you change the theme, the site changes and its appearance become different. There are thousands of free themes on WordPress.org. which could be used. However, many prefer to create their own themes because making a simple personalised WordPress theme is not difficult.

 

Required files

To create a theme you need two files only:

  1. index.php – main theme file, responsible for displaying content
  2. style.css – the main style file, responsible for CSS styles

index.php and style.css are just the main files required to create a simple theme. But to make the theme more convenient and extend its functionality, more files should be used:

  • header.php – responsible for displaying the header
  • footer.php – is responsible for the output basement
  • sidebar.php – responsible for displaying the sidebar
  • page.php – is responsible for the output of a single page (record)
  • etc.

 

The theme features

The possibilities of the theme are endless because there you can fully be written in  PHP. BUT! The theme is intended to display the content of the site in a certain way, and not to add functionality to the site.

Therefore, it is recommended to limit the scope of the theme to the appearance. All the other functionalities such as voting, ratings, redirects, SEO, etc must be used as plugins.

 

Thus, a theme can:

  • Display the contents of the site for different types of devices: monitors and smartphones. Such themes are called adaptive. Also, a theme can be fixed, single-column, two-column, etc .;
  • Display any content;
  • Help specify the content that will be displayed for different users;
  • Use any design elements (pictures, video).

As with any website, a theme is not only a colour scheme, a layout and a beautiful picture. Truly high-quality WordPress themes are also very functional, flexible and easily configurable. Their functionality does not add anything new to the site, but they are perfectly customized to the taste of the owner. For example: setting a background image, changing the colour of some components, configuration of the menu and blocks with content (widgets) …

 

How is the WordPress theme different from the plugin?

In terms of coding, there is no difference as the codes of a theme and a plugin are quite similar. But when taking a look at the logic, everything becomes different. The task of the plugin is to add something new to the site, for example, add a poll whereas The function of the theme is to display the content, including this poll …

Thus, the theme is responsible for displaying content on the page, and the plugin is needed to implement the functionality of the site.

Never add any functionality directly to the theme itself, unless there are good reasons to so.  Working directly on a theme might cause a loss of its functionally. For example, in your subject, there is a cool photo gallery. If you change the subject, then this cool photo gallery will be lost …

Therefore, any functionality related to editing / adding site content should be designed as a plugin.

 

Where to download WordPress themes?

Catalogue of themes on WordPress.org – one of the safest places to download free or premium themes. There all themes are checked for compliance with the requirements and recommendations.

There are other sources like “Creative Market” where WordPress themes can be downloaded, but there are usually paid.