function is_mobile() { if (is_page_cache_enable()) { return false; } if (is_tablet_mobile()) { return wp_is_mobile(); } $useragents = array('iPhone', 'iPod', 'Android.*Mobile', 'Windows.*Phone', 'dream', 'CUPCAKE', 'blackberry9500', 'blackberry9530', 'blackberry9520', 'blackberry9550', 'blackberry9800', 'webOS', 'incognito', 'webmate'); $pattern = '/' . implode('|', $useragents) . '/i'; return preg_match($pattern, $_SERVER['HTTP_USER_AGENT']); }
function is_responsive_enable() { return get_theme_mod('responsive_enable', false) || is_page_cache_enable(); }
<?php } //設定されたスキン ?> <?php //<meta name="viewport" content="width=device-width,initial-scale=1.0"> } else { //PC ?> <?php //<meta name="viewport" content="width=1280, maximum-scale=1, user-scalable=yes"> } //モバイル終了 //ビューポート //モバイルもしくはページキャシュモードの時 if (is_mobile() || is_page_cache_enable()) { ?> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <?php } else { ?> <meta name="viewport" content="width=1280, maximum-scale=1, user-scalable=yes"> <?php } //<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> ?> <?php /////////////////////////////////// //animatedModal.js関連ファイルの呼び出し ///////////////////////////////////
<?php //スクロール追従のサイドバーSNSシェアボタン if (!is_mobile() && !is_page_cache_enable() && is_all_sns_share_btns_visible() && is_obsequence_share_btns_visible()) { //サイドに追従SNSボタンが表示のとき ?> <!-- 追従SNSボタン --> <div id="sharebar"> <?php get_template_part('sns-buttons'); ?> </div> <?php }
<!--ページャー--> <div class="pager"> <?php global $wp_rewrite; $paginate_base = get_pagenum_link(1); if (strpos($paginate_base, '?') || !$wp_rewrite->using_permalinks()) { $paginate_format = ''; $paginate_base = add_query_arg('paged', '%#%'); } else { $paginate_format = (substr($paginate_base, -1, 1) == '/' ? '' : '/') . user_trailingslashit('page/%#%/', 'paged'); $paginate_base .= '%_%'; } if (is_mobile() && !is_page_cache_enable()) { $mid_size = 1; } if (is_page_cache_enable()) { //ページキャッシュモードの時 $mid_size = 2; } else { $mid_size = 3; } echo paginate_links(array('base' => $paginate_base, 'format' => $paginate_format, 'total' => $wp_query->max_num_pages, 'mid_size' => $mid_size, 'current' => $paged ? $paged : 1, 'prev_text' => '<span class="fa fa-caret-left fa-fx"></span> ', 'next_text' => ' <span class="fa fa-caret-right fa-fx"></span>')); ?> </div><!-- /.pager -->