I am new to PHP and WordPress and currently in learning phase.I am trying to append the host name of in my WordPress site URL so that i can change the host name at any time and here is waht i am trying to do
<?php
$site="siteurl";
$home="home";
?>
this is what i am trying to do in my php page
<link rel="stylesheet" href ="<?php echo get_cdn($site_cdn); ?>/wp-
content/themes/abc/scripts/fancybox/jquery.fancybox-1.3.4.css"
type="text/css" />
here is my get_cdn() function
function get_cdn($cdn_name){
if ($cdn_name="home" || $cdn_name="siteurl"){
return "http://id.cloudfront.net";
}
else{
return $cdn_name;
}
}
so what i am trying to do is if the pass in value to the function is either home or siteurl, it will return the URL of amazon cdn server so as per my understanding the above script should be like
<link rel="stylesheet" href ="http://id.cloudfront.net/wp-
content/themes/abc/scripts/fancybox/jquery.fancybox-1.3.4.css"
type="text/css" />
but this is coming as
http://localhost/wordpress/id.cloudfront.net/wp-content/themes/abc/scripts/fancybox/jquery.fancybox-1.3.4.css
i am not sure why this is happening and any help/pointer in this regard will be helpful