Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add <?php get_site_url(); ?> to pages?
#1
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.
Reply
#2
There are some plugins that can do a global migration for you
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
You don't add that to pages. You add it to the theme's template files.
Reply
#4
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...
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
(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?
Reply
#6
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
(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.  Huh
Reply
#8
I searched relative url
First result excluding this thread

http://get-simple.info/forums/showthread...l#pid56600
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
I thought this plugin of yours is about that:
http://get-simple.info/extend/plugin/gsc...eurls/900/
Reply
#10
Haha when did I make that?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#11
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.
Reply
#12
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#13
There are some other migration plugins listed here:

http://get-simple.info/wiki/plugins:guide#migration
Reply




Users browsing this thread: 1 Guest(s)