WordpressでプラグインのCSSを修正したのですが、反映されておらずその原因もわかっていません。
対象プラグインのCSSの読み込む順番を最後にしたのですが、デザインは変更されませんでした。
※テーマCSSはfunctions.phpの中に呼び出しの記述がされています
▼特定のプラグイン
search&filter(絞り込み検索の機能)
▼functions.php内のCSSの記述
//cssの読み込み function themeslug_enqueue_style() { wp_enqueue_style( 'theme-style', get_stylesheet_uri() ); wp_enqueue_style( 'fontawesome-style', 'https://use.fontawesome.com/releases/v5.1.0/css/all.css' ); wp_enqueue_style( 'swiper-style', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.7/css/swiper.min.css' ); } // 一旦読み込みを解除 function my_style1() { wp_dequeue_style( 'searchandfilter' ); } add_action( 'wp_print_styles', 'my_style1' ); // 再度読み込み function my_style2() { wp_enqueue_style( 'searchandfilter', plugins_url(),'/search-filter/style.css' ); } add_action( 'wp_print_styles', 'my_style2' ,99999 ); }
▼実際のソースにあるCSSの記述
読み込む順番を最後にしています。
<link rel='stylesheet' id='wp-block-library-css' href='https://gaicon-march.com/wp-includes/css/dist/block-library/style.min.css?ver=5.0.3' type='text/css' media='all'/> <link rel='stylesheet' id='theme-style-css' href='https://gaicon-march.com/wp-content/themes/jin/style.css?ver=5.0.3' type='text/css' media='all'/> <link rel='stylesheet' id='fontawesome-style-css' href='https://use.fontawesome.com/releases/v5.1.0/css/all.css?ver=5.0.3' type='text/css' media='all'/> <link rel='stylesheet' id='swiper-style-css' href='https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.7/css/swiper.min.css?ver=5.0.3' type='text/css' media='all'/> <link rel='stylesheet' id='amazonjs-css' href='https://gaicon-march.com/wp-content/plugins/amazonjs/css/amazonjs.css?ver=0.9' type='text/css' media='all'/> <link rel='stylesheet' id='searchandfilter-css' href='https://gaicon-march.com/wp-content/plugins/search-filter/style.css?ver=1' type='text/css' media='all'/>
どなたかお力添え頂けると助かります。
よろしくお願いします。
あなたの回答
tips
プレビュー