我有一个有两个站点的多站点。网站的英文和西班牙文版本。现在我的header.php上的logo是静态的。
<div class="logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/logo.png" alt=“Racing Logo” /></a></div>
我怎样才能使这个动态,以便有一个不同的标志为每一个?
你会调用什么函数?有没有什么东西可以让你检查你在哪个多站点上做一个if语句或类似的?
try this,
<?php
$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
switch ($language ){
case "fr":
//echo "Display french language text in this page";
include("index_fr.php");//include check session FR
break;
case "es":
//echo "Display Spanish language text in this page";
include("index_it.php");
break;
case "en":
//echo "Display English language text in this page";
include("index_en.php");
break;
default:
//echo "Display English language text in this page";
include("index_en.php");
break;
}
?>