WordPress.org

Ready to get started?Download WordPress

Forums

Adding external link (10 posts)

  1. Evong
    Member
    Posted 6 years ago #

    I have just installed WordPress and it's working. I need to add a link/button that reads "Home" which will direct users to my main website. Can someone help please?

  2. Justin Tadlock
    Member
    Posted 6 years ago #

    <a href="link-to-your-home-page" title="Home">Home</a>
  3. MouseClicks
    Member
    Posted 6 years ago #

    Can you hard code it into the footer? That's what I did anyway. I also always use target="_blank" in all external urls so that the page opens in a new browser window leaving the previous site open for returning to easily.

    Deb

  4. Joni
    Member
    Posted 6 years ago #

    It's considered bad form to force a browser to open a new window. Let the site visitor decide that.

    To Evong, I may be stating the obvious, but just put your complete URI in the anchor tag, like this:

    <a href="http://www.evong.com">Home</a>

    and you'll be just fine. :)

  5. Darkpress
    Member
    Posted 6 years ago #

    "Bad form"? I would think it's more of a personal preference, than any hard and fast rule.

    And the site visitor can decide whether to stay or go..the rest of it is up to the webmaster.

    Just my 2 pennies..not trying to argue.

  6. Joni
    Member
    Posted 6 years ago #

    It does go to accessibility issues for those folks browsing with screen readers. They cannot effectively use the "back" button if there's a new browser window opened AUTOMATICALLY. If a site is worth visiting, the person will hit the "back" button. Don't remove that choice for them.

  7. moshu
    Member
    Posted 6 years ago #

    "Bad form"? I would think it's more of a personal preference...

    Yes, but it would be my personal preference, as a visitor, not yours! A webmaster should NOT decide how MY browser should work. That's the basic rule.
    With my browser settings I will override anyway all your "smart" target things, so it will open as I want it. And I can right-click if I want it in a separate tab/window.

  8. xtra
    Member
    Posted 6 years ago #

    Hi there I am having a similar problem I have
    <a href="www.external-website.html" target="_blank">Another website</a>

    in the footer but when click the link it places the WP website url before the external link? eg

    www.WPsite/www.external-website.html

    Any suggestions to what I may need to do? i would of thought it to be easy but I must be missing something. I will keep searching the net too

  9. xtra
    Member
    Posted 6 years ago #

    A little embarrassing but the problem was I did not have http:// before the URL :P

    Code needs to be written like this:

    <a href="http://www.external-website.html" target="_blank"></a>

  10. Marclemar
    Member
    Posted 5 years ago #

    I have a photography orientated site with services listings in categorised directories so it's necessary for me to have new windows open as then people can browse various photographers or services listed with me without having to backtrack to my site to find another if the one they have clicked on is not for them.

    I know WordPress is set to open all links in comments etc to open in the same browser window, so in my directories where possible I always include Target="_blank" in the web links of each service listed and at first all seemed fine, my links were opening in a new window.

    I haven't changed anything but now these same links only open in the same window and as mentioned above it's a bit of a pain for my visitors to backtrack each time on a search especially with some sites not allowing visitors to go back to the previous site that they clicked through from.

    Is there a script I can add in my theme editor that will set all external links from my site to open in a new window ? and if not does anyone know why my Target="_blank" is suddenly not operating properly ?
    Any assistance on this would be appreciated .

    Cheers

    Mark

Topic Closed

This topic has been closed to new replies.

About this Topic