function wpmp_switcher_is_desktop_browser() { return !wpmp_switcher_is_mobile_browser(); }
function wpmp_switcher_wp_cache_check_mobile($cache_key) { if (!isset($_SERVER["HTTP_USER_AGENT"])) { return $cache_key; } $is_mobile = wpmp_switcher_is_mobile_browser(); $mobile_group = ''; $wp_mobile_pack_dir = WP_CONTENT_DIR . '/plugins/wordpress-mobile-pack'; if ($is_mobile && is_file($wp_mobile_pack_dir . '/themes/mobile_pack_base/group_detection.php')) { include_once $wp_mobile_pack_dir . '/themes/mobile_pack_base/group_detection.php'; $mobile_group = group_detection(); } if (isset($GLOBALS['wp_super_cache_debug']) && $GLOBALS['wp_super_cache_debug']) { wp_cache_debug("Lite detection says is_mobile: {$is_mobile} and group: {$mobile_group} for User-Agent: " . $_SERVER["HTTP_USER_AGENT"], 5); } $new_cache_key = $cache_key . $is_mobile . $mobile_group; // In the worst case we return the cache_key as it came in return $new_cache_key; }
</script> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/ja_JP/all.js#xfbml=1&appId=250318501786630"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <?php if (wpmp_switcher_is_mobile_browser()) { ?> <style type="text/css"> body{ margin-top: 200px; background: #fff url(<?php echo get_template_directory_uri(); ?> /img/common/bg_body.png) repeat-x center 160px; } </style> <p class="link_sp"><?php echo wpmp_switcher_link('mobile', 'スマートフォンサイトはこちら'); ?> </p>