Since you didn’t post actual code in your question, I can only speculate. However, a common problem is that, when calling home_url()
, it is not echoed. The value of the function is returned, rather than echoed, so it must be explicitly echoed by the code.
I’m guessing you have something like this:
<a href="https://wordpress.stackexchange.com/questions/95730/<?php home_url(); ?>">Home</a>
Which renders like so:
<a href="">Home</a>
…and would explain why the linked URL is the current page, rather than the expected URL for the site front page.
If so, change it to this:
<a href="https://wordpress.stackexchange.com/questions/95730/<?php echo home_url(); ?>">Home</a>
Related Posts:
- How to remove “http://” When Echoing URL?
- Unable to load static front page on home url
- Remove site root trailing slash
- Remove / from www.example.com/ [closed]
- hijacking home_url for root relative paths
- Showing my server ip in source code for several links not for all links
- Cannot access WordPress website from external IP while internally it is working properly [closed]
- Making a site URL
- Accidentally Changed WordPress Url
- My Website’s Main URL redirects me to an Archive Page
- Difference between esc_url() and esc_url_raw()
- Remove All Query Arg
- Pulling a parameter out of the URL of a WP link without “?” or being sent to a different page
- Run WordPress frontend and backend in different domains
- How to set global variable in functions.php
- Can’t login after my site was moved to a new server
- Adding a hook to ‘parse_request’ so that siteurl/pagename/xyz ignores “xyz”
- How to have numeric URLs in Posts and Pages
- Why WordPress automatically removes http from the url of my website’s sub domain?
- WordPress Move to SSL How to Update Media Assets to HTTPS?
- Moving wp-content outside of web root?
- permalink for category pages and posts
- Get url from file uploaded in Media Library
- Allow UTF-8 characters in the user slug part of URL
- WordPress converting ../url to http://../url
- URL parsing – what is it?
- Components used in Themes and Plugins: How to get file URL?
- Site URL always in front of other URLs
- Easiest way to simulate WordPress’s URL resolution to retrieve post ID, etc?
- How do I write the link from front-page.php to home.php?
- how to make URL link query string
- Allow Chinese character on post URL slug
- Displaying Post with Custom URL with RewriteRule or add_rewrite_rule
- How to get URL for the first page of post archive
- Newline URL entity when using esc_url()
- How to handle this URL Structure. Keep getting “page not found”
- Custom url in wordpress
- How to auto gen. custom post type values in other custom post type in url?
- WordPress get parameter ‘unapproved’ and ‘moderation-hash’
- Misentered the site address url. How to recover? [closed]
- Renamed my website (URL) – how do I rename all within-page links to the old URL?
- How to call for bloginfo inside function in functions.php?
- Moving a WordPress site – Installation issue
- What can I replace ‘.get_bloginfo(‘url’).’ with to return the current URL rather than the home address?
- How to get CGI variables?
- WordPress Subcategory Creates 2 urls for same page (serious issue)
- How to see an item in the admin from its URL? (not sure if it’s a page, post, or what)
- Can’t change the wordpress site url
- Pass form input via url variable
- Rewrite Most WordPress URLs
- Wrapping add_query_arg with esc_url not working
- Relative URLs within site
- How to make WordPress urls matching static html urls
- Using WordPress for a site’s static marketing pages and blog at different URLs
- What is the best way to revert to www version of domain name?
- Need to check if user is on a particular page
- Hook for feed creation?
- How to set path to the image instead of alt in media.php?
- Changed domain name and all the 301 redirects work except the ones for the thumbnail image which return 403 Forbidden error
- Changing url of author page
- How to get previous and Next Post Url in the_post_navigation
- How to remove % character from url
- Can non-latin characters appear in slugs?
- Encode URL for WhatsApp “click to chat” without loosing accented characters
- append currency to URL
- Create 600 links to separate files on google drive
- Locked myself out of WordPress because I changed my URL and computer shut down
- Cant access my wordpress.org locally
- I changed the URL [closed]
- WP site homepage displays url link at beginning of each featured post
- how to set url in admin option page
- Unable to login after changing WordPress site url
- Why is my WordPress URL shortened
- mysterious issue with stop words in urls not working – how can I restore multiple url access?
- What does this structure of the URL mean? http://www.example.com/?i=0
- How to create URL for Pages/Posts
- Private Messages between users
- Navigation and Permalink not getting correctly
- Moving Site: Is Re-downloading Files After Changing URLs necessary?
- How to create a dedicated folder for specific role via registration
- How to get the correct URL on my wordpress site?
- WordPress custom form post to different page
- Two domain site: Link base URLs point to wrong domain
- How to retrive previous Domain URL in Wp
- How to redirect WP post with a specific word in the URL
- Duplicate content with the same URL, google authorship
- Avoid too long words in a post title, post content or comment but only if its not a url
- Change URL to filter posts
- How to remove slug from url (custom post type)
- Accessing a file saved outside webroot in a wordpress post
- Why my wordpress site URL does not begin with my domain?
- Is There a Way to Schedule URL to Content Updates?
- I changed my url and cant access my site, Help?
- Accidentally changed the url
- Select Tab name to show in browser’s URL
- How to make media URLs Unique
- Dynamic Buttons According to URL parameter
- WordPress Address and Site Address differ
- WordPress URLs changed to relative on transferring server
- /?clearcache=1670318470 showing up in URL after client logs in