How to create templates for wordpress

How to create templates for wordpress

Users of the WordPress system have an opportunity to use ready styles of execution of pages or to create own to the taste. It is possible to apply the same template to all website, and it is possible to use several subjects for different types of pages. Structure formation of a template The WordPress templates have clear structure and represent set from several files of settings. First of all, it is the index.php file which connects several parts of a template in a whole, and style.css. Such files as header.php, footer.php, single.php, etc. are connected to the first. Them can be more if you want to create special type of the page. Set the main determination of style of a new template in the style.css file. For example, size of page, headlines and headings, appearance of the text, etc. Here you can place general information with a name of a subject, the author, the version number. The logo and standard navigation is set in the header.php file. In it you can place the code which is responsible for forming of the user menu. Navigation design, as well as any other element, is set in already described css-file. You should write settings of the homepage in the index.php file. They consist in designation of components and various functions. Act at discretion — add or remove the side menu, miniatures of messages, headlines. Adding of additional elements and installation of a template Having created obligatory structure of the WordPress template, you can add additional components on pages of your website. For example, create the functions.php and sidebar.php file. In the first place the code for registration of the side menu, and in the second — stilizuyushchy elements (arrangement, the text). If you want to add the system of comments to your template, connect in index.php the standard file of comments Wordpress — wp-comments.php. For adding on the website of archive in which old records will be located create the archives.php file. For installation of new design for your blog save all prepared files on your website in the wp-content/themes folder (it is possible to make it by means of ftp-connection). After that open "Control panel" Wordpress in the browser, click "Appearance" and "Subjects". The new template should appear already in the list. Activate it and install widgets necessary to you. It is possible to load own settings of design in the same menu item ("Subject") for this purpose click "Install subjects" and load archive with files of your template. In addition to the described way of creation of own design, you can use the special programs facilitating work to the beginner. For example, Artisteer allows to work in the usual tape interface and visualizes the majority of settings of a new subject.

Author: «MirrorInfo» Dream Team


Print