質問編集履歴

2

functions.phpを記載しました。

2019/12/01 04:37

投稿

hurousyotoku500
hurousyotoku500

スコア27

test CHANGED
File without changes
test CHANGED
@@ -119,3 +119,69 @@
119
119
  </header>
120
120
 
121
121
  ```
122
+
123
+
124
+
125
+ ↓functions.php
126
+
127
+ ```
128
+
129
+ <?php
130
+
131
+ //テーマのセットアップ
132
+
133
+ // HTML5でマークアップさせる
134
+
135
+ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
136
+
137
+ // Feedのリンクを自動で生成する
138
+
139
+ add_theme_support( 'automatic-feed-links' );
140
+
141
+ //アイキャッチ画像を使用する設定
142
+
143
+ add_theme_support( 'post-thumbnails' );
144
+
145
+ //カスタムメニュー
146
+
147
+ register_nav_menu( 'header-nav', ' ヘッダーナビゲーション ' );
148
+
149
+ register_nav_menu( 'footer-nav', ' フッターナビゲーション ' );
150
+
151
+ //メニュー用jsの読み込み
152
+
153
+ function navbutton_scripts(){
154
+
155
+ wp_enqueue_script( 'navbutton_script', get_template_directory_uri() .'/js/navbutton.js', array('jquery'), '', true );
156
+
157
+ }
158
+
159
+ add_action( 'wp_enqueue_scripts' , 'navbutton_scripts' );
160
+
161
+
162
+
163
+ //サイドバーにウィジェット追加
164
+
165
+ function widgetarea_init() {
166
+
167
+ register_sidebar(array(
168
+
169
+ 'name'=>'サイドバー',
170
+
171
+ 'id' => 'side-widget',
172
+
173
+ 'before_widget'=>'<div id="%1$s" class="%2$s sidebar-wrapper">',
174
+
175
+ 'after_widget'=>'</div>',
176
+
177
+ 'before_title' => '<h4 class="sidebar-title">',
178
+
179
+ 'after_title' => '</h4>'
180
+
181
+ ));
182
+
183
+ }
184
+
185
+ add_action( 'widgets_init', 'widgetarea_init' );
186
+
187
+ ```

1

header.phpを記載しました。

2019/12/01 04:37

投稿

hurousyotoku500
hurousyotoku500

スコア27

test CHANGED
File without changes
test CHANGED
@@ -3,3 +3,119 @@
3
3
  それぞれテーマフォルダ内に、別の画像を格納しているのですが、片一方の画像しか表示されません。
4
4
 
5
5
  どのような原因が考えられるでしょうか。
6
+
7
+
8
+
9
+ ↓header.php
10
+
11
+
12
+
13
+ ```
14
+
15
+ <!DOCTYPE html><!--htmlで書かれていることを宣言-->
16
+
17
+ <html lang="ja"><!--日本語のサイトであることを指定-->
18
+
19
+ <head>
20
+
21
+ <meta charset="utf-8"><!--エンコードがUTF-8であることを指定-->
22
+
23
+ <meta name="viewport"
24
+
25
+ content="width=device-width, initial-scale=1.0 "><!--viewportの設定-->
26
+
27
+ <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>"><!--スタイルシートの呼び出し-->
28
+
29
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"><!--font-awesomeのスタイルシートの呼び出し-->
30
+
31
+
32
+
33
+ <?php wp_head(); ?><!--システム・プラグイン用-->
34
+
35
+ </head>
36
+
37
+ <body <?php body_class(); ?>>
38
+
39
+ <header>
40
+
41
+ <div class="header-inner">
42
+
43
+ <?php
44
+
45
+ if(is_home()) {
46
+
47
+ $title_tag_start = '<h1 class="site-title">';
48
+
49
+ $title_tag_end = '</h1>';
50
+
51
+ } else {
52
+
53
+ $title_tag_start = '<p class="site-title">';
54
+
55
+ $title_tag_end = '</p>';
56
+
57
+ }
58
+
59
+ ?>
60
+
61
+
62
+
63
+
64
+
65
+ <div class="site-title-wrap">
66
+
67
+ <?php echo $title_tag_start; ?>
68
+
69
+ <a href="<?php echo home_url(); ?>">
70
+
71
+ <img src="<?php echo get_template_directory_uri() ?>/images/title.png">
72
+
73
+ </a>
74
+
75
+ <?php echo $title_tag_end; ?>
76
+
77
+ </div>
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ <!--スマホ用メニューボタン-->
86
+
87
+ <button type="button" id="navbutton" class="navbutton">
88
+
89
+ <i class="fas fa-bars"></i>
90
+
91
+ </button>
92
+
93
+
94
+
95
+ <!--ヘッダーメニュー-->
96
+
97
+ <div id="header-nav-wrap" class="header-nav-wrap">
98
+
99
+ <?php wp_nav_menu( array(
100
+
101
+ 'theme_location' => 'header-nav',
102
+
103
+ 'container' => 'nav',
104
+
105
+ 'container_class' => 'header-nav',
106
+
107
+ 'container_id' => 'header-nav',
108
+
109
+ 'fallback_cb' => ''
110
+
111
+ ) ); ?>
112
+
113
+ </div>
114
+
115
+
116
+
117
+ </div><!--end header-inner-->
118
+
119
+ </header>
120
+
121
+ ```