質問編集履歴
3
修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
if~elseの条件分岐を使いたいが効かない!
|
test
CHANGED
File without changes
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,6 +78,8 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
+
```PHP
|
82
|
+
|
81
83
|
<?php
|
82
84
|
|
83
85
|
|
@@ -225,3 +227,5 @@
|
|
225
227
|
}
|
226
228
|
|
227
229
|
?>
|
230
|
+
|
231
|
+
```
|
1
内容追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -65,3 +65,163 @@
|
|
65
65
|
|
66
66
|
|
67
67
|
なぜ、results.phpにいれたら条件分岐が効かないのかどうしてもわからず困っております。
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
ちなみにresults.phpは以下のような感じです。
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<?php
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
if ( $query->have_posts() )
|
86
|
+
|
87
|
+
{
|
88
|
+
|
89
|
+
?>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<div class="sandfnanken">
|
96
|
+
|
97
|
+
<?php echo $query->found_posts; ?>件見つかりました。<br />
|
98
|
+
|
99
|
+
全<?php echo $query->max_num_pages; ?>ページ中/<?php echo $query->query['paged']; ?>ページ<br />
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<div id="taxonomyList">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<ul>
|
118
|
+
|
119
|
+
<?php
|
120
|
+
|
121
|
+
while ($query->have_posts())
|
122
|
+
|
123
|
+
{
|
124
|
+
|
125
|
+
$query->the_post();
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
?>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<li>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<?php if (is_object_in_term($post->ID, 'bukken_category', 'salehouse') ): ?>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
ああああああああああああああああ
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<?php elseif (s_object_in_term($post->ID, 'bukken_category','chintai') ): ?>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
おおおおおおおおおおおおおおおお
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<?php endif; ?>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</li>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
<?php
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
?>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</ul>
|
174
|
+
|
175
|
+
</div>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<div class="sandfnanken">
|
182
|
+
|
183
|
+
全<?php echo $query->max_num_pages; ?>ページ中/<?php echo $query->query['paged']; ?>ページ
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<div class="pagination">
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<div class="nav-previous"><?php next_posts_link( '最後のページへ', $query->max_num_pages ); ?></div>
|
194
|
+
|
195
|
+
<div class="nav-next"><?php previous_posts_link( '先頭のページへ' ); ?></div>
|
196
|
+
|
197
|
+
<?php
|
198
|
+
|
199
|
+
/* example code for using the wp_pagenavi plugin */
|
200
|
+
|
201
|
+
if (function_exists('wp_pagenavi'))
|
202
|
+
|
203
|
+
{
|
204
|
+
|
205
|
+
echo "<br />";
|
206
|
+
|
207
|
+
wp_pagenavi( array( 'query' => $query ) );
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
?>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<?php
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
else
|
220
|
+
|
221
|
+
{
|
222
|
+
|
223
|
+
echo "その条件での物件はありません。";
|
224
|
+
|
225
|
+
}
|
226
|
+
|
227
|
+
?>
|