Questions about pages and links in wordpress

Asked

Viewed 43 times

1

I am developing my first theme, without having any previous experience with wordpress, I have some questions...

I will have to have several pages in my theme, I saw that I can separate into different files ("Pag1.php", "pag2.php", etc...), as I make the note to these pages in the menu of the site by the wordpress admin, so that it stays with friendly urls (ex: http://www.meusite.com.br/pagina-01/), I didn’t find anything like this in the WP admin, nor references to pages in functions.php or anywhere else.

These other pages will also receive parameters by the url, for example: http://www.meusite.com.br/pagina-01/param-01/param-02/ but I’ve basically seen how to solve...

If I asked in the wrong session forgive me, I confess that I have not researched much here in this forum yet.

  • Read about permalinks. Already give you an idea about friendly Urls. Here I gave an answer that talks about them, maybe she’ll help you too.

  • Welcome to the SOPT, a read before here http://answall.com/tour

1 answer

0

Actually, they’re two different things. There is the page that is where you edit the content, sets which url will use and etc. and there is which file of your theme wordpress will use to display the information of your page.

wordpress has a way to find out which is the best file to use, to better understand you can read here, but this graphic maybe give you a general idea a lot faster.

There is a way to assign a file of your theme to your page that is using the same Slug, that is, if the address of your page is /sobre wordpress will try to find page-sobre.php, but with this you tie the two things together and, if you need to change the page address, you may end up having problems. The best is to put at the beginning of your file something like

<?php
/*
 * Template name: Nome do seu template
 */

And on the editing screen of your page choose the template you created. I hope it’s a good start for you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.