Posts: 12
Threads: 1
Joined: Jun 2016
2016-06-28, 23:35:12
(This post was last modified: 2016-06-28, 23:35:32 by barknezz.)
Hey all,
Since we can't use PHP in pages, I'm trying to find an alternative to add <?php get_site_url(); ?> to pages. I'll move to website to another host so I don't want to change every link manually.
Thanks.
Posts: 6,267
Threads: 182
Joined: Sep 2011
There are some plugins that can do a global migration for you
Posts: 1,247
Threads: 82
Joined: Feb 2011
You don't add that to pages. You add it to the theme's template files.
Posts: 6,267
Threads: 182
Joined: Sep 2011
They mean they do not want absolute urls in their links in page content.
There are some mods you can do to change your siteurl to relative...
Posts: 12
Threads: 1
Joined: Jun 2016
(2016-06-29, 00:14:44)shawn_a Wrote: They mean they do not want absolute urls in their links in page content.
There are some mods you can do to change your siteurl to relative...
Yes this is what I'm talking about.
What mods are they exactly?
Posts: 6,267
Threads: 182
Joined: Sep 2011
You can remove the input type =url from the site settings and add a relative url there instead of full. Search the forums, it was recently discussed.
Posts: 12
Threads: 1
Joined: Jun 2016
(2016-06-29, 00:46:29)shawn_a Wrote: You can remove the input type =url from the site settings and add a relative url there instead of full. Search the forums, it was recently discussed.
I'm sorry, I could not find no matter what I wrote...
This must not be that difficult thing to do.
Posts: 6,267
Threads: 182
Joined: Sep 2011
I searched relative url
First result excluding this thread
http://get-simple.info/forums/showthread.php?tid=8471&pid=56600&highlight=Relative+url#pid56600
Posts: 1,247
Threads: 82
Joined: Feb 2011
I thought this plugin of yours is about that:
http://get-simple.info/extend/plugin/gsckerelativeurls/900/
Posts: 6,267
Threads: 182
Joined: Sep 2011
Haha when did I make that?
Posts: 12
Threads: 1
Joined: Jun 2016
Thanks @shawn_a! This is easy yet effective method.
However deleting root url from settings may cause problems if pretty url settings are like "parent/slug". I do suggest to use only slug, no parent directory in url to everyone who's gonna use this method.
Posts: 6,267
Threads: 182
Joined: Sep 2011
How so, it should not, permalinks are generated from permalink structure, not site url.
Also try that plugin out, i forgot about it, but it only affects links, not image paths, so probably not what you want.
Posts: 1,247
Threads: 82
Joined: Feb 2011
There are some other migration plugins listed here:
http://get-simple.info/wiki/plugins:guide#migration