質問編集履歴

1

試したこと追記

2017/12/16 18:39

投稿

mi2525mi2525
mi2525mi2525

スコア6

test CHANGED
File without changes
test CHANGED
@@ -42,6 +42,34 @@
42
42
 
43
43
  上記のコードをいくつかの箇所に挿入し試しましたが動作しませんでした。
44
44
 
45
+ また、wp_enqueue_scriptsにアクションフックを追加する形でやろうと調べて下記を試しましたがHTTP ERROR 500が出てしまいました。
46
+
47
+
48
+
49
+ ```
50
+
51
+
52
+
53
+ function register_style() {
54
+
55
+ wp_register_style( 'style', get_bloginfo( 'template_directory' ) . '/css/style.css' );
56
+
57
+ wp_register_style( 'article', get_bloginfo( 'template_directory' ) . '/css/article.css' ); }
58
+
59
+
60
+
61
+ function add_stylesheet() {
62
+
63
+ register_style(); wp_enqueue_style( 'style' );
64
+
65
+ if ( is_single() ) { wp_enqueue_style( 'article' );
66
+
67
+ elseif ( is_page( array('style') ) ) { wp_enqueue_style( 'style' ); } }
68
+
69
+ add_action( 'wp_print_styles', 'add_stylesheet' );
70
+
71
+ ```
72
+
45
73
 
46
74
 
47
75
  ###補足情報(言語/FW/ツール等のバージョンなど)