質問編集履歴
3
不足していた add_action pre_get_posts の行を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -90,6 +90,8 @@
|
|
90
90
|
|
91
91
|
}
|
92
92
|
|
93
|
+
add_action( 'pre_get_posts', 'change_posts_per_page' );
|
94
|
+
|
93
95
|
```
|
94
96
|
|
95
97
|
|
2
get_search_query()の値が取れない書き方になっていたのを修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,13 +12,21 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
|
15
|
+
search.php
|
16
16
|
|
17
17
|
```ここに言語を入力
|
18
18
|
|
19
|
+
<?php
|
20
|
+
|
21
|
+
$srch = "\t" . '<input type="hidden" name="s" value="' . get_search_query() . '" />' . "\n";
|
22
|
+
|
23
|
+
?>
|
24
|
+
|
25
|
+
|
26
|
+
|
19
27
|
<form method="get" action="/">
|
20
28
|
|
21
|
-
<
|
29
|
+
<?php echo $srch; ?>
|
22
30
|
|
23
31
|
<input type="hidden" name="sort" value="priceasc" />
|
24
32
|
|
1
商品一覧を出すタグを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -25,6 +25,14 @@
|
|
25
25
|
<input type="submit" value="価格が安い順" />
|
26
26
|
|
27
27
|
</form>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
<?php if(have_posts()): while(have_posts()): the_post(); ?>
|
32
|
+
|
33
|
+
商品タイトル
|
34
|
+
|
35
|
+
<?php endif; ?>
|
28
36
|
|
29
37
|
```
|
30
38
|
|