How to set up smartphones and PCs. Informational portal
  • home
  • Programs
  • Creating various WordPress themes manually and with the help of programs. Wordpress template layout from HTML layout

Creating various WordPress themes manually and with the help of programs. Wordpress template layout from HTML layout

Let's say we opened a new and so far empty presentation in Powerpoint. And what do we see?

And you have corporate colors and fonts that will have to be reconfigured every time. The template will allow you to do this once and for life.

And the 1st slide in your presentation will automatically look like this ALWAYS without further effort.


The template includes:

  • Colors
  • Fonts
  • Placeholders (sections where we insert text, image, chart, etc.)

Below you will find step by step instructions to create your own template in Powerpoint.

1. Create a new file in Powerpoint.

2. Select "Slide Master" from the top menu on the View tab.


A standard slide master will appear on the left.

That's what we'll be working with. And we will make a non-standard out of the standard.

3. Select the desired font theme or create a new one.

The font theme is the fonts you use in your presentation. Believe me, besides Calibri, there are plenty of other good fonts. Specify them only 1 time, and they will be automatically replaced in the entire presentation or template.


4. Select the background you want (color or pattern). You can choose the same background for all slides at once or for one special one.

5. As we can see, on the left there are many options for the location of text, title, etc. But what if we need one that doesn't exist? For example, to have 3 pictures with captions.


Then the function Insert Layout + Insert Placeholder will help us.

After we click "Insert Layout" a blank slide is created. And we can fill it however we want.


7. Now, if we are going to create a new slide, then we see the options from our template.

8. Creating a new presentation and "lost" your template? Go to the Design tab and look for it there.

Before laying out a site template in HTML / CSS, it must be worked out. It is customary to draw the design in Photoshop. The finished layout is saved in a format file .PSD.

As an example, let's create a website design in the figure below.

1. Opening Photoshop and create a new document in it ( File -> New or Ctrl+N).

2. Set initial parameters. In practice, it is almost impossible to think over a design with pixel accuracy - in the process of layout, something will definitely need to be changed, moved, redone. Therefore, the dimensions can be set approximate, and it is desirable to specify the width and height of the document knowingly larger than the planned dimensions of the site, so that all elements fit exactly in the layout. Let's make our document 1000 pixels wide and 1500 pixels high. Please note: pixels, not centimeters. Other parameters can be left untouched.

3. Turn on lines. During operation, they will be needed, because rulers allow you to measure distances very accurately. Check if you have rulers turned on. If yes, then you will see the scales next to the left and below the top toolbar.

If there are no rulers, turn them on ( View -> Rulers or ctrl+r).

The rulers should show the value in pixels. To switch to them from another measure of length, right-click on the ruler and select the corresponding checkbox in the menu that opens.

4. Check that the font size is in pixels, not in points. If not configured, go to Editing -> Preferences -> General, in the window that appears, go to the tab Units and rulers, in the dropdown list Text choose Pixels and press OK.

5. We immediately make the site substrate. Ours is a gradient fill of orange fading to yellow. Select a tool from the left panel Gradient.

On the panel that appears at the top, click the button specular gradient, select a color on the palette to the left.

Using the tools of the window that opens gradient editor, select the desired colors. To set the exact color of the control point, click on it, press the button Color and in the color picker window specify it in RGB, HSB, CSS or any other available format.

As a result of the manipulations, the gradient turned out as follows.

To apply a gradient to the current layer, hover over it with the pointer while holding down the left mouse button.

6. Save the background to a file. What we have done should be displayed below the main page and occupy the entire browser window - a kind of substrate. For example, the width of the site is 800 pixels, and the screen resolution of the user is much larger. The rest of the space (everything except for the very 800px that will be occupied by the page block) will be filled with a gradient background.

Since the screen resolution cannot be predicted, a one-pixel thick strip can be cut out of the created background and saved as an image. The browser will fill the background with it across the entire width.

6.1. Choosing a tool Rectangular area.

6.2. Select a strip of arbitrary width, but along the entire length of the layer.

6.3. Copy the selected area ( ctrl+c).

6.4. Create a new document Ctrl+N), set its width to 1 pixel and paste the copied ( ctrl+v).

6.5. We save the file in JPG-format.

7. Create the background of the page. The background will be plain white. Choosing a tool Rectangle and set the desired parameters in the properties window. We have a rectangle of 800x1100 pixels, the upper left corner of which lies at the point 100.0.

8. Making the background of the header. A gradient fill similar to a matte, 780x80px in size.

We save it as a separate graphic file with a width of 1 pixel, as we did with the background.

9. Create the top menu. Using the Horizontal Text tool, add the first menu item to the layout - home. The layer will be created and even renamed automatically, so you don't have to do anything with it.

It is important here that all points are evenly distributed, so the use of rulers is highly recommended. To extrude a vertical one, drag the pointer while holding down the mouse button from left to right. Using the rulers, measure the distance, given that each menu item should occupy 120 pixels in our case.

10. Insert the rest of the menu items in the same way.

11. Add a logo. We already have a finished one, so it remains only to carefully insert it into the layout. To do this, press File -> Open, then click on the image and, holding down the mouse button, move it to the header of the template document, when it opens, drag the image to the desired location in the layout and release the mouse button.

12. We write the name and slogan of the site. With the tool already known to us, we supplement the almost created logo with inscriptions.

13. Go to the sidebar. First, let's create and save a gradient fill for its titles as a separate file. Familiar with the tools, no explanation required.

14. Add the title text of the information block to the newly created gradient.

15. Draw the border of the area. To do this, just use a transparent rectangle with black outline lines. Select the Rectangle tool, set the fill type of the shape to No color, click the Set shape stroke type icon and select black, otherwise there will be no lines. If the outline is too thick, set the line width to 0.5 pt.

16. Below we add the title of the block with a gradient fill, as in paragraphs 12-13.

17. Create a left panel menu block. Add a 100px wide orange rectangle with a 0.2 pt yellow outline.

18. Add text to it.

19. Using duplication of layers and rulers, create five more menu items on the left panel.

20. We write the text in the main part of the page, using the same tool.

21. Add a photo to the main part of the page, as we did with the logo. To copy an image, simply move it with the mouse while holding down the key alt. If suddenly the picture does not fit in size, use the Transform tool ( ctrl+t).

22. Draw the background of the bottom of the site - an orange gradient with a length of 64 pixels.

23. Save the bottom background strip 1 pixel wide into a separate graphic file.

24. Reduce the height of the page. It turned out that all the elements have already been drawn, and there is still extra space left. This is where meaningful layer names come in handy. Among others, select the background layer (we call it that - Background) and using the Transform tool reduce the height of our white rectangle to the bottom edge of the page footer.

25. Save the template to a format file .PSD (File -> Save).

26. The result of this action was still a simple, but already normal-looking site template.

Now, from the PSD layout, it remains to create a site template using HTML / CSS, but I will talk about this in the next article.

If you want your wordpress site to become promising, then for a start you should think about creating a unique theme for it. This process is quite laborious, because it is directly related to various encodings and scripts. Let's break it down from scratch.

Almost every wordpress theme is installed in the wp-content/themes directory and consists of 3 categories of files:

  1. style sheet files;
  2. files of additional functionality;
  3. template files.

Stylesheet files are style.css. They are responsible for the color, size, font and other parameters of the site elements. Each site has only 1 style.css file. If you open this file, then at the very top you can see information about the title, author and a brief description of the topic. When creating your own theme, you can enter information about yourself in style.css.

The next category are files of additional functionality. These include functions.php, the principle of which makes it look like a plugin. Thanks to this file, you can visually customize the theme right in the admin panel. Usually the list of settings is not very wide (site name, color of navigation and sidebars of the site, and so on). If the theme is multifunctional, then the list of settings will be much wider.

Now let's move on to the template files. Their main function is to generate pages that are requested by site visitors. Template files have a ".php" extension. Most basic themes can only contain one template file called index.php. In this case, all pages of the site will be identical. Such a design is most often used to create online resources with databases, when design does not play a key role.

If you've never done any design before, you should try creating a simple theme first. For its normal operation, you will need at least 2 of the following files: style.css and index.php.

Files of additional functionality in this case can not be used, as you understand. Among template files, index.php is one of the most flexible. It can independently generate headers, various blocks, the bottom (footer), content and other elements of the site.

It is worth noting that those parameters that are not generated by the index.php file will be generated by standard files. For example, if your theme consists only of the 2 files listed above, but the user needs to generate a form for adding comments, then in this case the standard comments.php will perform this function. Therefore, if you want your theme to be more unique, then it is worth making additional template files. Let's consider the main ones.

  1. To add comments, you guessed it, the comments.php template is used.
  2. If you want to make a popup window with comments, then for such purposes you will need comments-popup.php.
  3. To generate the main page, home.php is used.
  4. The single.php file is responsible for displaying the site's articles. If you do not have such a file, then index.php will perform its function.
  5. The page.php file also generates individual pages of the site.
  6. You will need author.php to display information about the author.
  7. Category.php is responsible for categories.
  8. The display of archives, date and search is done by archive.php, date.php and search.php files respectively.
  9. In order for your site to display a unique 404 error page, you will need to add your 404.php.
  10. The top and bottom of the site is generated by the header.php and footer.php files, respectively.

Creating a unique theme manually from scratch

First you need to install the appropriate template. It can be found both on the official site wordpress.org, and on any other. It is recommended to use the official site, because any third-party site may contain malicious files and broken links.

After you make your choice, you can start downloading the archive. At the end of the process, you will need to unpack it and upload the files to certain site folders (the archive usually contains a small instruction). The download can be done using the FileZilla program or directly from the hosting, if it supports this option. Now you just have to go to the "Themes" section, select the one you downloaded, and click on the "Activate" button.

You can also select it directly in the WordPress admin panel. In this case, you do not need to download it. You will only need to click on the "Install" button, and then "Activate". Before installation, it is proposed to carry out a preview.

Now that the theme is activated, you can proceed to its uniqueness. The first step is to think about the top of the site (header). This is the first thing that will catch the eye of your visitors, so you should take it responsibly. Typically, the header consists of the site name, logo and brief information about the content. The header can be created in any graphics editor. Even in standard Paint. More advanced designers use Adobe Photoshop.

The site name should be short and easy to remember. In Adobe Photoshop, you can pick up many different styles for it. When creating a logo, you may need different shapes. They can be downloaded from the official website of Adobe Photoshop.

After you make a header drawing in a graphic editor, you will need to upload it to your site. When the download is complete, a URL will appear to the right of the picture, which you will need to copy. Then you will need to go to the "Editor" section and select the file that is responsible for generating the header (header.php). In it, you will need to find the URL of the current image and replace it with the one that you received when loading the header image. After that, you will need to update the file. Now we can move on to checking the display of the header.

If your header does not have the same parameters as the standard one, then they can be adjusted in header.php. The width is controlled by the width attribute, and the height is controlled by the height attribute. The setting can be done in pixels and percentages. So, if you just want to stretch the header, then set it to 100%.

If desired, you can add active links to the pages of the wordpress site in the header. This can be done using various services. There are plenty of them on the Internet. Most of them work on the same principle. You circle the desired area of ​​​​the header, which will be allocated for the link, and the service will give you the desired code. Then you will need to add this code to the header.php file. Be careful when adding it. Every point matters. If you add the code in the wrong place, active links will not appear in the header.

After replacing the standard header, you can start replacing the standard wordpress site background, widgets, navigation, bottom (footer) and other components of the wordpress site. They can also be drawn in any graphics editor and uploaded to the site as a picture.

When you should consider that it should not be bright. Most webmasters prefer to use a white background. It does not hurt the eyes and does not distract from the main content.

To create a quality navigation from scratch, you will need a little knowledge about tags such as




  • The first is responsible for creating site blocks, the second is for adding links to the wordpress site. With the help of the third column can be created. The latter is needed to set up cells. The first step is to decide on the place where the navigation will be located. Usually it is located directly under the cap. Navigation layout is a fairly fast process. Below is a small example of how you can lay out a small navigation block.

    As you already understood, the conditional name of the block with navigation is navigacia. The block consists of one cell "page name". Note that each tag is closed with a "/" character. If the tags are not closed, then the site may malfunction.

    Shouldn't be big. The most popular are calendar, tag cloud, meta, archives, search, rss, videos and breaking news. To add them, you need to go to the "Appearance" tab and click on the "Widgets" field. You will then see a list of available options. Widgets can also be installed using plugins. They can be downloaded both from the official website and directly through the WordPress admin panel. To add a video that is on YouTube, you just need to paste the link to it in the desired place on the site. Otherwise, the video will need to be uploaded to the site. If you are into programming, you can add your own widget to the site. To do this, you need to click on the "Text" option and enter the necessary code there.

    In the settings of each widget, you will be given the opportunity to change the default titles. You can also choose where to display the widget (right or left sidebar) and so on. Removing the widget shouldn't be a problem. To do this, you just need to click on the "Delete" button in the settings.

    Creating a unique theme using special programs and services from scratch

    1. The most popular is the Artisteer program. To work with it, you do not need special knowledge in the field of programming. The creation process takes place in a visual mode. What you draw will be rendered using code that complies with the "XHTML 1.0 Transitional" international standard. Thanks to this, the theme of your future site will be supported by all browsers.

    To work with you will be offered a wide selection of different effects, styles and much more. This program supports Russian, English, German and other languages. It should be noted that this program has some disadvantages. The most significant is that the program costs about $50. There is also a free version, but it contains very few options. To increase the uniqueness of the template, you will have to additionally delve into the encoding.

    Let's go directly to the instructions for working with this Artisteer program. Once you open the program, the first option to appear is called Ideas. It will offer you various combinations of standard elements. If you want your design to be unique, then
    you don't need this option. In order to master the program, you just need to click on the options and view the parameters. This program is lightweight, so you shouldn't have any problems with it.

    Pay attention to the "Header" option. She is responsible for displaying the header of the site. You have the option to use the default header or upload your own. How to make a unique hat, you already know.

    To adjust the site width, you will need to use the "Sheet" option. The width is specified in pixels. This program will initially offer you a width of 900 pixels. Also, using this option, you can adjust various effects (shadow, rounded edges, and so on).

    The "Background" option is responsible for setting the background, you guessed it. You can choose from standard options or upload your own.

    If you want to customize the layout of the site elements, then you should use the "Layout" option.

    An equally important option is "Articles". It is the layout of the design of articles site. This includes the location of the picture, text, comments, various blocks, and so on.

    To select a color, size, or font for the text, you need the Colors and Fonts option.

    After the done actions, you can save your creation. To do this, click on the palette, which is located in the upper left corner. A window will appear in front of you. In it you need to click "Save As". After that, you just have to choose the file name and location. Please note that the file must have the ".artx" extension. For further work with the program, you only need to click "Save" once to save.

    When your theme is fully developed, you can move on to exporting it. To do this, you need to click on the "Export" tab and select "WordPress Theme".

    2. If you are fluent in Adobe Photoshop, then you should install the Divine Elemente add-on for it. Thanks to it, you can easily convert a .psd file into a format that will be supported by all browsers.

    3. If you do not have money for Artisteer, then you can use the free Lubith service. It is available online on the official website lubith.com. The service contains many useful options and is particularly fast. In just a couple of minutes, you will fully master all its options.

    4. An analogue of the previous service is WordPress Theme Generator. It is also easy to use and contains a wide range of different options. This service is absolutely free. The only drawback is that this service only supports English.

    5. XTemplate Generator is a Russified theme generator for the site. Its options are in the left window, and in the right window you can see the visual result of your work. This generator is also free.

    6. WPTheme Generator is much more powerful than the previous ones, because it contains several times more options. The only caveat is that this service is paid. The price is 30 dollars. It is also worth noting that the layout in it is carried out entirely in English.

    7. CSSEZ is no less popular than the previous one. Before you start, you will need to go through a small registration. In this service, you can lay out up to 4 columns for site materials. You can upload your own background.

    8. Dotemplate provides you with about 11 different wordpress templates that you can modify. The only drawback is the inability to upload your own graphic file. Therefore, you will have to upload the header yourself through the site's file manager.

    9. Weebly differs from the rest by having the option to add videos directly from YouTube or Google anywhere on the site. A site that has a video is a success, because visual information is faster and easier to perceive.

    10. In the Eris’ Template Generator service, you can add up to 3 columns to display site materials, add various tags, a calendar and other widgets.

    Now I will explain how to make a WordPress theme from a simple HTML template using the design example from that article.

    You may need to adapt the design for WordPress for many reasons, for example, you are transferring your once static site to a CMS, or you like a design that is not yet in the WordPress collection, or you just want to understand how the themes of this CMS are arranged from the inside.

    So let's get started.

    Distribute code across files

    1. Download the template and unzip it to your WordPress themes folder (address like blog_url_wordpress/wp-content/themes/). If you want, rename the theme folder to your liking. For example, my template is located at wordpress_blog_url/wp-content/themes/MyTheme/.

    2. Rename the file styles.css v style.css.

    3. Open style.css in a code editor (such as Notepad++) and at the very beginning, paste the following lines:

    /* Theme Name: MyTheme Theme URI: http://test1.ru Author: NoName Author URI: http://test1.ru Description: Example of test Version: 1.0.0 License: GNU General Public License v2 or later License URI : http://www.gnu.org/licenses/gpl-2.0.html */

    As you might guess, this is service information about the theme: title, author, description, license, version, etc. You can replace the right parts of the lines with your own, that is, set your authorship, version, description, and other data.

    4. Create files header.php, index.php, sidebar.php, footer.php and distribute the code over them from index.html.

    4.1. V header.php copy the code line by line , since this file is responsible for the top of the site. styles.css replace in code with style.css- new valid file name.

    4.2. V index.php paste the main block code (from the line line by line ).

    4.3. V sidebar.php copy the side menu code (from on ).

    4.4. V footer.php paste the remaining lines (with to the end of the document index.html).

    5. Remove index.html.

    6. Go to the admin panel and make sure that the MyTheme template has appeared in the section Appearance -> Themes. You can even try to view or activate it, but nothing good will come of it yet, because we haven’t integrated the template with WordPress yet.

    Adapt header

    Now we will start from a static template to make a dynamic theme into which WordPress data and settings will be loaded.

    The template will contain PHP inserts. This code starts with. Between them is PHP code, most often calling CMS functions.

    1. Open the header.php file and replace the code contained in it up to the block

    to the next one:

    > "> "> "type="text/css" media="screen" /> <?php bloginfo("name"); ?>

    We made the block dynamic

    The code calls a function that returns the language attributes to the container.

    ">

    Instead of setting the encoding as a constant, we called a function that takes a value from the CMS settings and automatically substitutes it into the code, that is, to change the encoding, you no longer have to edit the theme file.

    An important function that ensures the work on the page of styles, plugins and scripts.

    2. Proceed to editing the index.php file. At the very beginning, write

    ,

    Lines call header, sidebar and footer files.

    Now you can view or even activate MyTheme. As a result, the browser will display a familiar template with a static menu and a single page. In order for the menu to become dynamic and customizable, and instead of one page to display all the materials placed on the site, you need to convert the template further.

    Making the top menu dynamic

    So far, we have a completely static theme, including one with the same horizontal top menu. While it cannot be configured from the admin panel, and if you leave the code in its current form, then you will have to edit the file each time to insert / delete / move items header.php which is extremely inconvenient.

    In order not to philosophize slyly and not to plunge into the abyss of the fascinating world of programming, we will give the dynamic menu a static name. Paste the code instead of the horizontal menu table

    so that it looks like this:

Top Related Articles