How to create a static page in WordPress. How to make a home page in WordPress How to make a home page in WordPress

Sometimes you need to make sure home page on the WordPress engine we had a static one. The meaning of this action is that when we go to the blog for the first time, the announcement of articles will not be displayed on the start page, but simply static information will be displayed ( for example with a blog description), and the blog itself will be in a separate tab ( page). When we click on this tab, only then do we see article announcements.

Some info-businessmen use this method. When you go to them, you immediately see a static page on which there is complete information about the blog, its purpose, various subscriptions or some information products. Also, many companies and organizations use this method. First, a static home page is shown with a full description of the company. All this is done in order to first familiarize the visitor or customer with your company or website, and only after that offer him some of your services. How to implement this on the engine?

Go to the control panel, select the menu “ Options» —> « Reading". At the top we have just such an item as to what to display on the main page. We are asked to select either the latest posts or some permanent static page that we will use. But before we do this, we naturally need to create this permanent page. To do this, go to the menu “ Pages» —> « Add new". At the top we assign the name of the page ( for example, About the site), then fill out and publish the text that will be displayed when you first enter your blog. In the test, you can, for example, write what your blog is about, your offers and services, your subscription form, and so on.

Now we need one more page - this page to display posts from our blog. Using the same method, we add a new page. In the title of the page we write Blog, after which we simply publish it without any entries. Now if we go back to the menu " Options» —> « Reading“, then here at the top we put an item to display a static page on the main page. In cell " Home page" select the item " About the site“that we created. Cell " Posts page» — this page where announcements of our blog posts will be displayed. In this cell, select the item “ Blog", then click on the button " Save changes«.

Now when we go to our WordPress engine blog and update it, we will display a static start page “ About the site". If we click on the page " Blog“, then we will already display all announcements of blog posts.

Today we have a topic for beginners about what is the home page of a WordPress site? How to create it, in what cases is it needed, what to do with it and how best to arrange it?

It may seem surprising to some, but nevertheless, as my practice of communicating with readers shows, quite a large part of WordPress users fall into complete stupor when it comes to creating the main page of a website or online store, for example. Why is this happening?

This is probably because, by default, after installing a new site and a standard theme, WordPress displays a general post feed. In essence, it’s an archive template, which strictly speaking cannot be considered a page at all. And it is impossible to change it or supplement it in simple ways. Despite the fact that most bloggers are quite happy with this functionality, there are more and more users who want to customize the “facade” of their site as they need.

First of all, these are various corporate and thematic sites for which it is important to show something other than simple posts on the main page. Products, services, tables and the like. And it's really, really easy to do.

Creating the main page of a WordPress site

You can read more about what pages are and how they differ from posts. We will immediately begin creating the main page for the site. In the admin panel we are looking for a section - Pages and click - Add new. Set the name (traditionally - Home, Home and the like). Leave the content field empty for now. Click - Publish.

A new page has been created and appears in the general list of your pages. Don't forget to disable comments on it by unchecking the corresponding checkbox. It's up to you, of course, but the comments on the main page look strange, to say the least.

We also remember that now the main page of your site will not have the usual post feed. For it, you need to immediately create another page, for example, Blog or News. We create it by analogy with the main one. Another option is to completely abandon the general feed of posts and display them exclusively by category.

Now let's go to the section - Settings - Reading, switch to - Static page and in the drop-down lists select the previously created pages for the main page and for posts.

Your site now has a new home page. For now it is completely clean and empty. How and with what help it is better to fill it with content, we will consider below.

Of course, you can simply use the standard WordPress editor to place some necessary content on the main page. But it’s unlikely that you will create a home page just to write plain text with a couple of pictures on it.

Page builders

The most popular way to create unique pages today is through various visual composers. The “king of the hill” here is undoubtedly the famous Visual Composer with a whole “brood” of its own and third-party add-ons. You can read more about this great plugin at.

https://vimeo.com/92033601

The popular plugin designer is constantly gaining more and more followers, both premium and free. You can read about some of them, for example, here. The essence of working with such plugins is to visually drag and drop and customize blocks with various pre-prepared elements and your content. Moreover, recently such builders have been able to work not only from the admin panel (back-end), but also from the front end, that is, you can create your page directly from the outside of the site. It’s very convenient and visual - you immediately see all the results of your creativity.

Shortcodes

Another very similar way to arrange your home page is to use special plugins with . Of the free ones, it’s worth highlighting

or here’s another good plugin - Easy Responsive Shortcodes.

There are a huge variety of both free and premium plugins for using shortcodes. Just type the Shortcodes keyword in the search bar on wordpress.org. Often, sets of shortcodes are already built right into themes (premium) or come as proprietary plugins included with themes.

There are universal plugins, with a large set of different shortcodes, and there are more highly specialized ones. For example, only for organizing and displaying content in equal columns - Column Shortcodes. It is quite possible that this functionality will be enough for you.

Displaying records and portfolio

But perhaps you have a more local task. For example, you only need to change the appearance of your posts. Nowadays the so-called Grid style is very popular. That is, the output is in the form of rectangles in several rows and columns. To implement this, you will need a great plugin with which you can display your content in a huge variety of effective ways.

Another, similar option is a plugin. It is true that it is more focused on displaying galleries and portfolios.

And another great plugin with flexible settings and a beautiful appearance of already prepared templates - . Highly customizable, with many options will help even the most picky blogger customize the output of posts.

For the most budget-conscious, there are also free plugins - or Gridster. They don’t have as many features as premium ones, but for their purposes they are quite suitable.

As you can see, there are more than enough options for creating and arranging the main page of the site “for yourself”. It all depends on your requirements and the theme of the site.

Do you, dear readers, use a home page on your blog or website?

WordPress one of the most responsive and popular systems for managing and creating a website. The number of available extensions (so-called plugins), the abundance of themes with different designs and functionality make it easy to create a business card website, portal, or online store. The scope for creative thought is enormous, but it begins WORDPRESS still with home page. If you have just installed WordPress, It’s time to make adjustments to suit your needs, and at the same time you need to take into account a thousand important details if you want to make a pleasant and visited blog, and not put together an auto-filled GS (shit website). So let's work on wordpress home page.

Before working on your WordPress site, I want to remind you of a few important points you need to know:



Basic files in wordpress

You shouldn’t immediately jump into the style sheet or mindlessly edit the following files:

  • index.php (this is what displays the main page of the site);
  • header.php is responsible for the site header; it also opens a tag, after which, by the way, the codes for all traffic statistics counters are placed;
  • style.css is responsible for the style of the template; it sets the appearance of the site elements (this is where the miracles of editing the main page in WordPress will work).

All possible methods: from simple to complex

WordPress is a very flexible system that provides many options for editing the home page and design. For example, you can use the standard features of the control panel or directly correct the code in index.php - but in this case you must know exactly what and how you want in the end, otherwise your WordPress site will simply be unavailable and you will have to return everything to the starting point.

Where to find places where you can edit the main page of the site, like the rest of the other pages:

  • admin panel;
  • hosting file manager;
  • using an ftp client (FAR or FileZilla)

Let's look at how to edit the home page through the WordPress admin panel. On the one hand, this is the simplest method, but on the other hand, it does not allow code errors to occur. So be careful.

Standard settings

The easiest way to set up the home page is in the standard editor. That is, edit the topic. There are editing options depending on the template you choose. Most often, you can simply change the background color, image, site name, text color. You can also make changes to the menu and work with WordPress widgets. When editing a theme, you should pay special attention to the “static home page” tab. This is where you specify which page you choose to be your home page.

File style.css - style sheet

You should start editing the main page of the site with the style.css file. It's quite easy to find. First, you need to log into the admin panel of your WordPress. In the console, find the Appearance tab and go to the style.css file. This is a fairly large text file.

After you make all the changes, do not forget to click the “update file” button to save the changes.

So, the Description line is responsible for describing the topic; the version, author, and tags that will be used further are also indicated there. Just below the style.css file is a list of values ​​used in all pages of the site: headers, field indents, lists.

In WordPress, after the body tag you can make your own changes:

  • background color;
  • size, color, font style;
  • background scrolling;
  • shape and size of the displayed page.

For example:

Background: url(images/bg_g.jpg) repeat #000 fixed; color: #2c2b2b; font: normal 12px arial; line-height: 18px; position: relative.

In this case, the value “#2c2b2b” means the color that the text will have.

All values ​​that are defined like: background: url(images/sprite_master.jpg) are used to edit images. These can be completely different versions of png: from buttons to pictures and backgrounds. Graphic files must be uploaded to the storage directory and links to them are taken from there and inserted instead of “sprite_master.jpg” as in our example.

For example, the custom_header block is responsible for creating a picture in the header of the main page. It may be referred to as default_header.jpg. The method for changing it is described above. It is also possible to change the image size. For example, if there were 2500 x 1600 pixels, then for effective display it is better to set 1800 x 600.

It is important to remember that each of the hundreds of parameters in the style.css file is responsible for a specific area of ​​the site.

Static page

In order to make a main page that will be static. This means that certain text will be visible on any of the pages. This option is necessary for pinning news or advertising on your site; unfortunately, it is available for older versions of WordPress.

Results of changes

Changing templates in WordPress is not that difficult. For beginners, it will be useful to visit the website wordpress-theming.ru, where a description and examples of various themes are given for installing them on your portal. Those who want a more difficult route can edit the home page of their site themselves.

Here we described one of the ways to edit the home page for your website through the admin panel. Besides this, there are two more ways. They are somewhat more complex and require more user training. Before starting with them, we can advise you to have a good practice with the main page in the style sheet.

By default, the home page of a WordPress blog is the page that displays the most recently published posts (or announcements). But you can make the posts page not the main one and call it, for example, “Latest posts” or “Blog”, and assign a main page with other, possibly static content. In this article:

Creating a Static Home Page

You can use one of the permanent pages as the main page:
In your WordPress admin panel, create at least two pages (Pages>Add New).

1. Home page

Give one page the title you want to use for your home page, such as "Home", enter the content of the page, and publish it.

*** You can create a separate custom template for this page, the name of which should be different from home.php, because otherwise it may cause conflict.

2. Posts page

Name the second page “Blog” (or “News”, “Articles”) and publish it. This page will show blog posts (announcements), so you don't need to add content to it (it is ignored) and use a custom template for it.

3. Settings

On the administrative page of the Reading settings(Reading) select option " Display on the main page - Static page", indicate the pages you want to use as home page("Home") and like posts page(“Blog”) and save your changes.

4. Menu

If your theme uses a menu of permanent pages, such as the header (theme file header.php) or the blog sidebar (theme file sidebar.php), the page you designate as the main page will also appear in this menu. To exclude this page from the list of pages displayed in the menu, you need to change the corresponding theme template that is used for this master page.

Changing Theme

Excluding a page from the menu

Displays a menu of pages function, for which you can set the exclude parameter to the id of the page (or pages) that you want to exclude from the menu, or for the include parameter, list the ids of the pages that you want to include in the menu, separated by commas (here the id of the main pages =10):

Home Page Selection

In a template, you can choose content for the main page that is different from the content for other pages by using is_front_page() returns true when the home page assigned in Settings is displayed as shown above. For example, on the main page you don’t have to display a side menu. To do this, in the theme's index.php file, instead of the line

you need to write:

Programmatic home page selection

wp_insert_post() allows you to programmatically create About and Blog pages.

ID); update_option("show_on_front", "page"); // Post pages (blog) $blog = get_page_by_title("Blog"); update_option("page_for_posts", $blog->ID); // Switch to the theme //switch_theme("Template", "stylesheet"); ?>

is_home() and is_front_page()

is_home() checks whether the current page is a posts page.
is_front_page checks whether the current page is the main page of the site.
By default in WordPress the main page is the posts page, so the functions is_front_page() And is_home() both check for being on the main page.

Sometimes you need to make sure home page on the WordPress engine we had a static one. The meaning of this action is that when we go to the blog for the first time, the announcement of articles will not be displayed on the start page, but simply static information will be displayed ( for example with a blog description), and the blog itself will be in a separate tab ( page). When we click on this tab, only then do we see article announcements.

Some info-businessmen use this method. When you go to them, you immediately see a static page on which there is complete information about the blog, its purpose, various subscriptions or some information products. Also, many companies and organizations use this method. First, a static home page is shown with a full description of the company. All this is done in order to first familiarize the visitor or customer with your company or website, and only after that offer him some of your services. How to implement this on the engine?

Go to the control panel, select the menu “ Options» —> « Reading". At the top we have just such an item as to what to display on the main page. We are asked to select either the latest posts or some permanent static page that we will use. But before we do this, we naturally need to create this permanent page. To do this, go to the menu “ Pages» —> « Add new". At the top we assign the name of the page ( for example, About the site), then fill out and publish the text that will be displayed when you first enter your blog. In the test, you can, for example, write what your blog is about, your offers and services, your subscription form, and so on.

Now we need one more page - this page to display posts from our blog. Using the same method, we add a new page. In the title of the page we write Blog, after which we simply publish it without any entries. Now if we go back to the menu " Options» —> « Reading“, then here at the top we put an item to display a static page on the main page. In cell " Home page" select the item " About the site“that we created. Cell " Posts page» — this page where announcements of our blog posts will be displayed. In this cell, select the item “ Blog", then click on the button " Save changes«.

Now when we go to our WordPress engine blog and update it, we will display a static start page “ About the site". If we click on the page " Blog“, then we will already display all announcements of blog posts.



Any questions?

Report a typo

Text that will be sent to our editors: