Support » Fixing WordPress » How to add relative links within a site?

  • Hi,

    I am developing a site in a subdirectory. When it goes live I will move it to the root directory.

    However, I need to link from lots of places to the “contact us” page.

    How can I put links in such that when I relocate the site they are still valid?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Edward Caissie

    (@cais)

    Theme Review Admin, The JellyBeen Man

    Something along this line should work:

    <a href="<?php bloginfo('url'); ?>/contact-us/">Contact Us</a>

    esmi

    (@esmi)

    Forum Moderator

    Will that work inside the post/page content without a run-php plugin?

    Edward Caissie

    (@cais)

    Theme Review Admin, The JellyBeen Man

    Will that work inside the post/page content without a run-php plugin?

    Not likely, and a good point to make. I would expect the code above to be used as “hard-code” in the custom template(s)/theme being created.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add relative links within a site?’ is closed to new replies.