WordPress Snippet: How to get Home page link

WordPress Snippet: How to get Home page link

The home_url template tag retrieves the home URL of your WordPress current site. If you want to hardcode link to you homepage anywhere in your custom WordPress theme you can use the snippet below to add link to your WordPress website homepage.

Add this WordPress snippet to get Home Page URL


<?php echo get_home_url(); ?>
<a href="<?php echo get_home_url(); ?>" title="Your Home Page Title" rel="bookmark">Home</a>

The WordPress snippet above will output: https://www.example.com with the domain and the schema matching your settings and website.

Autor: wpsnipp | Modified: April 22, 2019 at 9:44 pm


Leave a Reply

Your email address will not be published. Required fields are marked *

  • That’s awesome this piece of code speed my site results in GT Metrix and Pingdom. Thanks

  • Free Stuff says:

    Woah! I’m really digging the template/theme of this site. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between usability and visual appeal. I must say you have done a excellent job with this. Also, the blog loads very quick for me on Chrome. Superb Blog!

  • Nery Halle says:

    I really like your blog, So thanks a lot for these great information and keep the good work shared as usual.Thanks, I will share it on Here

  • Jamie Dockson says:

    Thank you for sharing superb informations. Your web site is so cool. I’m impressed by the details that you’ve on this website. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found just the info I already searched all over the place and just could not come across. What an ideal site.

  • Free Stuff says:

    Hi there! I know this is kinda off topic but I was wondering which blog platform are you using for this site? I’m getting sick and tired of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

  • Hairstyles says:

    Hello! I’ve been following your weblog for a while now and finally got the courage to go ahead and give you a shout out from Porter Texas! Just wanted to tell you keep up the fantastic job!

  • Freebies says:

    Excellent post. I used to be checking constantly this weblog and I’m inspired! Very useful info particularly the last phase πŸ™‚ I handle such information much. I used to be looking for this certain information for a long time. Thanks and best of luck.

  • Genevieve Fernandez says:

    I cannot thank you enough for the article.Really thank you! Keep writing!

  • AffiliateLabz says:

    Great content! Super high-quality! Keep it up! πŸ™‚

  • Arthur Rychlewski says:

    I am doing all of that, link farms, buying links on fiverr, spamming guest books and comment sections, etc. Guess what,I am getting a ton of traffic with blackhat seo and never got a penalty. DonΒ΄t believe iPenuin, Panda and all those fairy tales they are telling you. Google is dumb as fuck!

  • Advertising

    Related posts

    What does the_content and get_the_content do in WordPress?

    What do the_content and get_the_content do in WordPress?

    The WordPress functions the_content and get_the_content are used to pull the main text area from the page or post. The difference between them …

    Change The Color Of Wordpress Admin Dashboard Icon In The Menu

    How to change Dash icon color in WordPress admin menu with CSS?

    Change the default color for dash icon in the admin menu Probably you have this question when you create a Custom WordPress Theme …


    Wordpress Resources | Snippets | Themes


    Do you need a custom Wordpress Template?


    You are on the right place if you need specific design, functions or template/s for your WordPress website. Did you ever ask some of the Questions Below?
    • How do I create a custom WordPress template?
    • How customisable is WordPress?
    • How much does a custom WordPress theme cost?
    • How do I edit the content of my WordPress site?
    • How do I create a menu in Wordpress?
    • What is the default template in Wordpress?
    • How do I upload a theme to Wordpress?
    • How do I create a new page in Wordpress?
    • How do I add a template to Wordpress?
    • How do I add a subpage in Wordpress?
    • How old is Wordpress?
    • What are Wordpress pages?
    • How can I create a template?
    • How do I change my theme in Wordpress?
    • What is a taxonomy in Wordpress?
    • Can you copy a page in Wordpress?
    • How do I convert HTML to Wordpress?
    • How do I change the layout of one page in Wordpress?
    • How do I set a front page in Wordpress?
    • How do I change the layout of my Wordpress blog?
    • How do I change the header in Wordpress?
    • How do I change the header text in Wordpress?
    • How do I edit the top bar in Wordpress?
    • How do I change the top header in Wordpress?
    • How do I change my logo in Wordpress?
    • How do I edit headers and footers in Wordpress?
    • How do I hide the admin bar in Wordpress?
    • How do I hide the toolbar in Wordpress?
    • How do I edit text on a Wordpress site?
    • How do I remove the Powered by Wordpress?
    • How do I change my social media links on Wordpress?
    • How do I add my Instagram feed to Wordpress?
    • How do I link Facebook to my Wordpress website?