Hi gusc,
Thanks for this post. I assume you referring to the Site Address URL setting on the Settings->General admin screen vs. the WordPress Address URL (??) This issue as been a bit of a confusing mess for some time. I will take another look at it and see how I can accommodate all (or at least more) of the possible configurations.
Thanks.
-Mark
Thread Starter
gusc
(@gusc)
Yeah, strangely enough get_site_url returns the “WordPress Address (URL)”
while get_home_url returns the “Site Address (URL)”.
In my particular case
WordPressurl = http://www.domain.com/wordpress
Site url = http://www.domain.com
So for my visitors wordpress is not part of the url structure..
Where this gets interesting is when creating games the posts are setup as
http://www.domain.com/game/{gameid} (in the admin pages) (a valid page)
but the links from the tables point to
http://www.domain.com/wordpress/game/{gameid} (results in a 404 error page)
The code in my first post corrected this, so it pointed to http://www.domain.com/game/{gameid} (the valid link, and it displays correctly).
I can send you the link to our site if you would like, but would rather not post it for general view.
Anyway hope that helps.
I’m assuming that before you could accept this change, someone would need to confirm that when siteUrl is not set in the admin page, that get_home_url still returns the wordpress url.
You got it. That’s the issue. I need to figure out how to handle changes to both the WordPress URL and the site URL. I suspect WP provides a function or function to handle the various cases, I thought I was using it, but I guess I’ll dig a bit deeper. Thanks.
-Mark