wptouchでマルチサイトのテーマ反映
-
マルチサイトを作成しています。
スマホ用をwptouchを利用してテーマを分けたいのですが、http://ameblo.jp/buyship/entry-11185928711.html
こちらを参考に、wptouch.phpをfunction get_stylesheet( $stylesheet ) {
if ($this->applemobile && $this->desired_view == ‘mobile’) {
return ‘default’;
} else {
return $stylesheet;
}
}function get_template( $template ) {
$this->bnc_filter_iphone();
if ($this->applemobile && $this->desired_view === ‘mobile’) {
return ‘default’;
} else {
return $template;
}
}を下記へ書き換えました。
function get_stylesheet( $stylesheet ) {
$mysiteid = $GLOBALS[‘blog_id’]; //ブログIDを$mysiteidに代入
if ($mysiteid == 1) { //もしブログIDが1だったら
if ($this->applemobile && $this->desired_view == ‘mobile’) {
return ‘corp’; //ここは新たにコピーしたブログ1用のテーマの名前
} else {
return $stylesheet;
}
} elseif ($mysiteid == 2) { //そうでなくて、ブログIDが2だったら
if ($this->applemobile && $this->desired_view == ‘mobile’) {
return ‘portal’; //ここも新たにコピーしたブログ2用のテーマの名前
} else {
return $stylesheet;
}
}
}//こちらも同様に
function get_template( $template ) {
$this->bnc_filter_iphone();
$mysiteid = $GLOBALS[‘blog_id’]; //ブログIDを$mysiteidに代入
if ($mysiteid == 1) { //もしブログIDが1だったら
if ($this->applemobile && $this->desired_view === ‘mobile’) {
return ‘corp’; //ここは新たにコピーしたブログ1用のテーマの名前
} else {
return $template;
}
} elseif ($mysiteid == 2) { //そうでなくて、ブログIDが2だったら
if ($this->applemobile && $this->desired_view === ‘mobile’) {
return ‘portal’; //ここも新たにコピーしたブログ2用のテーマの名前
} else {
return $template;
}
}
}しかし、PC版スマホ版ともに真っ白になってしまいます。
なにか、書き方がまずいでしょうか。PHPがわからず、困っています。
どうぞ、宜しくお願い致します。
- トピック「wptouchでマルチサイトのテーマ反映」には新たに返信することはできません。