..


Sponsored Links

Create a simple theme for WordPress

Article written by Claudio Garau
Page 1 of 10

Create templates for WordPress does not require a procedure by extremely difficult to be able to accomplish, however, must have good knowledge about the language of HTML markup and CSS are also required even basic skills on planning in the Server Side PHP. This brief discussion of course was written starting from the assumption that the reader possesses such consocenze.

In a WordPress template, ie the look and feel of a Web site based on this blog engine, is displayed through a structure called a "theme", a graphic theme is practically the whole of a series of files that integrate all the elements that are used for the construction of a template, not all topics are made of the same type and same number of files, it is generally not possible to propose a basic structure:

  • header.php: it has the necessary code to the header of the site and in general all the elements that must esssere repeated at the top of the page layout;
  • index.php: pesenti the Home Page of the website that is usually the first page that appears to access;
  • page.php: contains the template of the inside pages of the Website;
  • comments.php: integrates the layout code for the form to list the comments and the comments themselves;
  • sidebar.php: contains the code for the sidebar in which typically are integrated elements of navigation, archvi and widgets that allow access to ancillary functions;
  • single.php: presents the layout of individual articles for reading;
  • search.php: contains the code of the page showing the results of research;
  • style.css: the style sheet that contains all the attributes for CSS formatting;
  • functions.php: it must be included custom functions that these shall go into action in the event that created the theme becomes the default.
  • footer.php: contains a section on the footer of the layout and the tags and closing graphics.

It is no coincidence that the themes for WordPress are spread over multiple files respecting what is the logic of a 'modular architecture where each file represents a different module of the theme and the theme is the same form of CMS, this approach makes it possible to separate clearly the application code from presentation.
On closer inspection in fact, only the "index.php", "page.php", "single.php" and "search.php" really belong to the structure of the blog engine, the others are and represent elements of the theme of the inclusions.

In this way, only those who want to make changes to the header of the site may do so only by acting on "header.php", adding navigation elements can be made by altering only "sidebar.php" and so on, all without having to not only edit, but not even open the other files that make up the theme.

The advantage of this "modular" is also in the fact that, acting on a single file, any changes will be valid for the entire graphic layout of a blog, so should not be having to hack every single page.

In the same category ...
E-Learning
HTML (Course) HTML (Course)
The markup language for the Web from 29 €.
MySQL (Course) MySQL (Course)
Management of open-source database. From 39 €.
PHP (Course) PHP (Course)
Full course for creating dynamic Web sites. From 49 €.
Sponsored Links