admin管理员组文章数量:1399847
an unexpected '}' is reported for } else {
<?php
function mg_get_selected_taxonomy_dropdown_term() {
return isset( $_GET[ 'state' ] ) && $_GET[ 'state' ] ? sanitize_text_field( $_GET[ 'state' ] ) : '';
}
$selected_term = mg_get_selected_taxonomy_dropdown_term();
$states = get_terms('state'); $i = 0;
if ($selected_term != "ALL") {
foreach ( $states as $state ) :
$doctors = new WP_Query(array(
'post_type' => 'doctor',
'orderby' => 'name',
'order' => 'ASC',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'state',
'field' => 'slug',
'terms' => $state->slug
),
array(
'taxonomy' => 'state',
'field' => 'term_id',
'terms' => $selected_term,
),
)
));
} else {
foreach ( $states as $state ) :
$doctors = new WP_Query(array(
'post_type' => 'doctor',
'orderby' => 'name',
'order' => 'ASC',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'state',
'field' => 'slug',
'terms' => $state->slug
),
)
));
}
?>
本文标签: wp queryWhere is the coding error for the unexpected 3939 in this ifelse choice of loops
版权声明:本文标题:wp query - Where is the coding error for the unexpected '}' in this ifelse choice of loops? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744646484a2617428.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论