質問編集履歴
2
search-hoge.phpの中身について追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,5 +23,33 @@
|
|
23
23
|
どのように記述すれば適用されるでしょうか。
|
24
24
|
|
25
25
|
---
|
26
|
+
|
26
27
|
追記
|
27
|
-
is_search()を利用すれば適用されるのですがsearch.phpには適用させたくないので利用できませんでした。
|
28
|
+
is_search()を利用すれば適用されるのですがsearch.phpには適用させたくないので利用できませんでした。
|
29
|
+
|
30
|
+
---
|
31
|
+
|
32
|
+
追記2
|
33
|
+
searchform2.phpは固定ページfuga(page-fuga.php)に
|
34
|
+
|
35
|
+
```php
|
36
|
+
<?php get_template_part( 'searchform2' ); ?>
|
37
|
+
```
|
38
|
+
を記述して表示させています。
|
39
|
+
|
40
|
+
functions.phpに
|
41
|
+
```php
|
42
|
+
function custom_search_template($template){
|
43
|
+
if ( is_search() ){
|
44
|
+
$post_types = get_query_var('post_type');
|
45
|
+
foreach ( (array) $post_types as $post_type )
|
46
|
+
$templates[] = "search-{$post_type}.php";
|
47
|
+
$templates[] = 'search.php';
|
48
|
+
$template = get_query_template('search',$templates);
|
49
|
+
}
|
50
|
+
return $template;
|
51
|
+
}
|
52
|
+
```
|
53
|
+
以上を記述してsearch-hoge.phpを表示させています。
|
54
|
+
search-hoge.phpの中身は固定ページfuga(page-fuga.php)にプラスして
|
55
|
+
searchform2の検索結果を表示させています。
|
1
試したこと
title
CHANGED
File without changes
|
body
CHANGED
@@ -20,4 +20,8 @@
|
|
20
20
|
```
|
21
21
|
以上のように記述したのですがsearch-hoge.phpにfuga.cssが読み込まれません。
|
22
22
|
固定ページfugaとpiyoカテゴリアーカイブには読みこまれています。
|
23
|
-
どのように記述すれば適用されるでしょうか。
|
23
|
+
どのように記述すれば適用されるでしょうか。
|
24
|
+
|
25
|
+
---
|
26
|
+
追記
|
27
|
+
is_search()を利用すれば適用されるのですがsearch.phpには適用させたくないので利用できませんでした。
|