In the previous article I told you how to create to sidebar additional with the purpose of to be able to remove more yield to him to which samples in each page. Perhaps in a section of your Web you prefer to show to the last articles in the lateral bar but in another one a subscription form the blog. Nevertheless, to get to obtain this and to take advantage of you will to the maximum need it to know how to create groups for the pages of WordPress.
Exactly this last one is what we are going to see in this article and you will see that is even easier that the previous tutorial.
Creating groups will allow you to create new structures, from simplest and well-known as fullwidth until most complex than you can imagine. What seems to you if we began seeing how are created and later we looked for some ideas?
How to create Plantilla Personalizada or Page Warm up to you
To create a customized page is very simple and practically any person would have to be able to do it without problems, so you do not have any type of fear! ð
In order to begin you have two options: to create a new file PHP or to duplicate classic page.php that you will find in the folder of your theme. I recommend two things to you to do the easiest life in the future to you:
- It tries that the name of the file that you have created is most descriptive possible (page-fullwidth.php, no-sidebar.php, etc)
- Themes for these modifications uses child, if you do not know how a look throws to this article
In order to finish only creating it (yes, we finished already) you will have to add something as the following thing:
<? php/* Tempers Yam to you: My customized group *? >
And it is already created. Or I told you that it was the more easy that to create to sidebar almost or just as to make your shortcodes ð
In order to try that everything has left correctly you will have to add a new page to your WordPress and in the part Attributes of page you will find a drop-down one with groups. There you will find the one that you finish creating with the name that is to him. In order to prove it we are going to insert something of HTML to see what so is, with a pair of line will be enough:
<? php/* Tempers Yam to you: My customized group *? > <h1>Mi customized page is leche</h1>
It prints the HTML correctly and as we can see allows to construct a page us totally cleans, without WP sign. The normal thing is that loop exists to show the information that we add when creating the page, the title and others¦ is very simple. If you have duplicated the file page.php you will know to what I talk about. In any case, it will depend on how we want to orient the group.
Adapting our group in the style of WordPress
Not to leave our so sober group we will give the same style him that to the rest of the Web. For it we will have to incorporate some basic elements of WP that are in charge to generate all the content with a pair of functions. A pair of lines more and¦
<? php/* Tempers Yam to you: My customized group * to get_header (); > <div id= " contained class= " contained " > <! -- From we showed the content here -->¦ </div> <? php to get_sidebar (); //We called when sidebar if we want to show it to get_footer (); >
With this we must have the group finished and prepared to use it under the same style that the rest of our subject. Evidently it is a very basic group that we will have to modify more if we want that it has some utility (in fact right now nor it will show the content of the page).
Why it can serve to create a group
So that it has certain utility you will have to give a return him to which we have done in this tutorial. Create to me, this it is only the principle of that you can personalize so much as you want, but is necessary to start off from here.
Now that you know the system to create Page Templates in WP you will be able to create pages as¦
- A listing of authors with information exceeds they and its publications
- A ordered article list of a certain category as you want
- A page that shows articles with certain labels
- Page of testimonies or recommendations
- The customized page of contact with a form, map and another information
- ¦ and much more
Also it will serve you to even modify the design by means of CSS according to the group that is used or to play with conditional thanks to the function is_page_template (). All this I leave it in your hands, the best form to learn is practicing in your own projects ð
Or you know, as always, any doubt or asks sends it through the commentaries. And if you have some idea in mind I would like to also read it! ð