WordPress (WP) is: an open-source content management system for a website; written in PHP;
database server – MySQL;is licensed under a free software license.Applications range from simple blogs to complex news resources and online stores. The huge variety of Quality WP themes, and plug-ins together with a successful architecture allows you to design projects with wide functionality.According to the latest reports from BuiltWith, W3tech, and many other publications, CMS WordPress, Joomla, and Drupal are the absolute favorites on the world market of site-building.The free engine WordPress takes first place with a share of 58.8%; Joomla and Drupal follow with a serious gap – 6.5 and 4.8% of the global CMS market.
To begin with, you should acclimate yourself with the fundamental understanding of PHP programming and the WP layout itself.WordPress has good documentation, including translation. This makes working with the CMS much easier. Usually, it is enough to call the WordPress functions in the right place in a regular HTML template, which can often be copied directly from the documentation. Perhaps this is all the difference between layout under WordPress and just layout of the template.Further, I will tell you about the most interesting process – the layout of an HTML template for WordPress.
Create a folder to store all the files that are include in the template site. Add the HTML markup with the following code, where the future template will be divided into three parts: header, body, and footer.We create text files in the format .php. Consider what each of them is responsible for: header.php – the upper part of the template. The code in this file is written once. Then it does not need to be written anew, it is enough to use the variable in other files.
– output of entries on the main page of the blog. The file is quite short, it contains code for search output and widgets, which can be changed from the blog admin.archive.php – pages of headings, tags, and navigation on the blog.For example, you can output all entries from the same header, or all entries marked with the same tag.
– a page for outputting posts from a blog search. The file is almost no different from index.php, except for the output of a user search query.
comments.php: – comments on the site.
page.php – output the content of pages on the blog. For example, such as “Contacts” or “Site Map”.
some functions on a blog, almost any code can be add to it. For example, you can output breadcrumbs without a plugin, just add the right code and use it further on any page of the site.It is important not to forget to create a style.css file and a folder for images.At this point, the preparation of the template can be considered complete, then proceed to the layout.
The template must be divide into a header, the body, and the footer. To mask some elements, WP provides many precondition functions (is front page(), is_404() etc.). If it is necessary to change the style – CSS can, body_class() is available.If there are image galleries on your site (four or seven in a row, for instance), you should make a template of these pictures, which is generate by the WP shortcode gallery. Or reconstruct this shortcode and make the layout, following the rule “Matching to list, Matching to the list item, Matching after list”, if the functionality of WP in terms of a number of rows and columns and other redundant.
Leave a Reply