Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
I'm trying to get the URL of various pages on my site in phpPlugins so I can add something only on the home with ttg_main_bottom.
The code i'm using is: $actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
except it always returns the home page URL on each page except for the galleries
eg: I always see https://stalkinglight.com even when the page URL is https://stalkinglight.com/about/.
Charlie
www.stalkinglight.com
Offline
Hi Charlie,
I use following function to determine if I am on the home page:
function is_home_page() {
if ( $_SERVER["REQUEST_URI"] == '/' ) {
return 1;
} else {
return 0;
}
}
Based on what you wrote, this doesn't seem to work for your host
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Thanks Daniel,
I'm doing something wrong since I have the exact same code in both ttg_main_bottom and ttg_single_bottom and the results are different - works fine in ttg_single_bottom but only returns the home page URL in ttg_main_bottom.
I'm using a LAMP server on my own computer.
Charlie
www.stalkinglight.com
Offline
OK, I figured it out. I was using "=" instead of "==" in my comparison so I was actually assigning the variable instead of comparing them. Obviously I've forgotten my C/C++ days.
Charlie
www.stalkinglight.com
Offline
OK, I figured it out. I was using "=" instead of "==" in my comparison so I was actually assigning the variable instead of comparing them. Obviously I've forgotten my C/C++ days.
Great! Don't know how many hours total I lost overlooking this type of typo....
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Pages: 1