STINGERは、プラグイン不要でいろいろできるようにfunctions.phpに記載しているコードが多いため一部のプラグインは上手く動かない事があります。干渉するプラグインはコチラをご参考下さい。
うまく動かない時に試していただきたい事は以下の通りです。
プラグインを全て止めてみる。
症状が改善される場合は1つづつプラグインを有効化して「原因」のプラグインを探します。
functions.phpをシンプルにする
functions.phpの内容を以下の必要最低限にしてみて下さい。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
<?php function register_user_script() { if (!is_admin()) { $script_directory = get_template_directory_uri(); wp_deregister_script('jquery'); wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'); } } add_action('init','register_user_script'); //アイキャッチサムネイル add_theme_support('post-thumbnails'); add_image_size('thumb100',100,100,true); add_image_size('thumb110',110,110,true); //カスタムメニュー register_nav_menus(array('navbar' => 'ナビゲーションバー')); //カスタムヘッダー $args = array( 'width' => 986, 'height' => 150, 'flex-heighnt' => true, 'default-image' => get_template_directory_uri() . '/images/stinger3.png', ); add_theme_support( 'custom-header', $args ); //RSS add_theme_support('automatic-feed-links'); //エディタスタイル add_theme_support('editor-style'); add_editor_style('editor-style.css'); function custom_editor_settings( $initArray ){ $initArray['body_class'] = 'editor-area'; return $initArray; } add_filter( 'tiny_mce_before_init', 'custom_editor_settings' ); //画像に重ねる文字の色 define('HEADER_TEXTCOLOR', ''); //画像に重ねる文字を非表示にする define('NO_HEADER_TEXT',true); //投稿用ファイルを読み込む get_template_part('functions/create-thread'); //カスタム背景 add_theme_support( 'custom-background' ); //ページャー機能 function pagination($pages = '', $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link (1)."'>« First</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link ($i)."' class=\"inactive\">".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">Next ›</a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>"; echo "</div>\n"; } } //ウイジェット追加 if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(4) ) register_sidebars(1, array( 'name'=>'サイドバー1', 'before_widget' => '<ul><li>', 'after_widget' => '</li></ul>', 'before_title' => '<h4 class="menu_underh2">', 'after_title' => '</h4>', )); register_sidebars(1, array( 'name'=>'スクロール広告用', 'before_widget' => '<ul><li>', 'after_widget' => '</li></ul>', 'before_title' => '<h4 class="menu_underh2" style="text-align:left;">', 'after_title' => '</h4>', )); register_sidebars(1, array( 'name'=>'Googleアドセンス用', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h4 style="display:none">', 'after_title' => '</h4>', )); register_sidebars(1, array( 'name'=>'Googleアドセンスのスマホ用width300', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h4 style="display:none">', 'after_title' => '</h4>', )); //contents widthの指定 if ( ! isset( $content_width ) ) $content_width = 546; //ショートコードを外す function stinger_noshotcode( $content ) { if ( ! preg_match( '/\[.+?\]/', $content, $matches ) ) { return $content; } $content = str_replace( $matches[0], '', $content ); return $content; } ?> |
尚、上記コードに張り替えると日本語URLが有効化され「URL」が変わる場合があるので御注意下さい。
ページャー機能も外したい場合など、個別に取り扱いたい時は
コチラをご参考下さい。
jQueryを読み込み直す
functions.phpの初めの方にある
1 2 3 4 5 6 7 8 |
function register_user_script() { if (!is_admin()) { $script_directory = get_template_directory_uri(); wp_deregister_script('jquery'); wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'); } } add_action('init','register_user_script'); |
を削除してheader.phpなどで任意の読み込みをして下さい。
【注意】
functions.phpを変更するとサイトが「真っ白」になる場合があります。
まず、先にfunctions.phpのバックアップを取って置き、
症状が出た場合は、FTPツールでfunctions.phpを上書きし直すか、最悪削除すれば
だいたい復帰します。