I found a bug after using Avada theme and found ‘avada_before_main’ wasn’t triggering.
I’m running a reverse proxy therefore my webserver/php is running on a different port (8080), as such geodir_curPageURL() reports that the directory is running on port 8080 and not 80 as seen externally.
For a temporary fix I’ve modified geodir_curPageURL() to ignore the port and now ‘avada_before_main’ is behaving as expected.
function geodir_curPageURL() {
$pageURL = ‘http’;
if (isset($_SERVER[“HTTPS”]) && $_SERVER[“HTTPS”] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
//if ($_SERVER[“SERVER_PORT”] != “80”) {
//$pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”];
//} else {
$pageURL .= $_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”];
//}
//return str_replace(“www.”, “”, $pageURL);
return $pageURL;
}
Is it worth putting an option somewhere to either autodetect this somehow, or a checkbox in the admin section to ignore the port number?
Failing that, could you add a filter so I can override this in my functions.php?