How to create a fixed link in wordpress?

Asked

Viewed 1,347 times

3

I am implementing a site in html static for wordpress, are not all pages that need the cms to manage the content, my problem is the following!

I cannot create a Menu link to a static page or any page Wordpress 4

example

<a href="contato.php">contato</a>
Simplesmente ele não consegue encontrar a página contato.php

in the best of worlds this should work because I’ve tried because they are all in the same directories, I’ve seen on Codex that wordpress works differently but I’ve tried several solutions and nothing, someone can give a help.

  • Which menu? In http://seu-site/wp-admin/nav-menus.php? Put http://seu-site/caminho/contato.php doesn’t work?

  • You did not talk about the Wordpress version, however this plugin should solve your problem: Wordpress Page Links To

  • You want to link to a page or an external link?

  • @Gabrieltadramainginski manjo little wordpress saw the plugin but do not know if that’s what I need

  • @Giulianogriffante and for an internal page.

  • @brasofilo and a menu of the site itself that I am passing to wordpress and need to create a so chamda for it to work properly?

  • Helton, I don’t know what a "chamda so"... (?) is. . . Can [Edit] answer the question? It’s not at all clear what its configuration is.

  • @brasofilo and a menu of the site itself that I am passing to wordpress and need only create the links with the other pages.

  • It’s... I can’t understand, Sorry...

  • @Brasofilo No problem worth...

Show 5 more comments

2 answers

3

From the link you have placed, it seems that the.php contact is like a relative link. This means that the browser will search the page depending on the current path you are browsing.

Example, if you are at site.com.br/category/article/
The link above will be your site.com.br/category/article/contact.php

If you are on your site.com.br/about/
The link will be: seusite.com.br/about/contact.php

So, all you have to do is put the full path to your contact.php. For example, if you put the file inside the domain root, the link is:

<a href="/contato.php">contato</a>

(Also, in your original post, you closed the tag with </p> instead of </a>)

So, check exactly where the page you want to link to is (via the same browser) and use the relative link correctly.

1


After creating the page in the wordpress admistrative in the href attribute you should put the path as follows

<a href="<?php bloginfo('url')?>/nomeDaPagina">Link da pagina</a>

Browser other questions tagged

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