質問編集履歴
1
試したこと追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -20,6 +20,20 @@
|
|
20
20
|
|
21
21
|
###試したこと
|
22
22
|
上記のコードをいくつかの箇所に挿入し試しましたが動作しませんでした。
|
23
|
+
また、wp_enqueue_scriptsにアクションフックを追加する形でやろうと調べて下記を試しましたがHTTP ERROR 500が出てしまいました。
|
23
24
|
|
25
|
+
```
|
26
|
+
|
27
|
+
function register_style() {
|
28
|
+
wp_register_style( 'style', get_bloginfo( 'template_directory' ) . '/css/style.css' );
|
29
|
+
wp_register_style( 'article', get_bloginfo( 'template_directory' ) . '/css/article.css' ); }
|
30
|
+
|
31
|
+
function add_stylesheet() {
|
32
|
+
register_style(); wp_enqueue_style( 'style' );
|
33
|
+
if ( is_single() ) { wp_enqueue_style( 'article' );
|
34
|
+
elseif ( is_page( array('style') ) ) { wp_enqueue_style( 'style' ); } }
|
35
|
+
add_action( 'wp_print_styles', 'add_stylesheet' );
|
36
|
+
```
|
37
|
+
|
24
38
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
25
39
|
より詳細な情報
|