文は3つの条件がある場合は、次の:このコードは、私のページを破っているいくつかの理由3つの条件を持つこのPHP if文で何が問題になっていますか?
<?php if (is_archive()) : ?>
<?php $topic_tag_term = get_query_var('term'); ?>
<?php // Display the top topics of current forum
$args = array(
'post_type' => 'topic',
'posts_per_page' => '3',
'topic-tag' => $topic_tag_term,
'r_sortby' => 'highest_rated',
'r_orderby' => 'desc',
'order' => 'DESC'
);
?>
<?php $term = $wp_query->queried_object; ?>
<p>The following are a list of topic tagged as <strong><?php echo $term->name ?></strong>.</p>
<?php if (bbp_current_user_can_access_create_topic_form()) : ?>
<a id="new-entry" href="<?php echo home_url('/'); ?>/create-topic">Start a new topic</a>
<?php endif; ?>
<?php if (is_page_template()) : ?>
<?php // Display the top topics of current forum
$args = array(
'post_type' => 'topic',
'posts_per_page' => '3',
'r_sortby' => 'highest_rated',
'r_orderby' => 'desc',
'order' => 'DESC',
'meta_key' => '_bbp_reply_count',
'meta_value' => '1',
'meta_compare' => '<'
);
?>
<?php else : ?>
<?php // Display the top topics of current forum
$args = array(
'post_type' => 'topic',
'posts_per_page' => '3',
'post_parent' => $post->ID,
'r_sortby' => 'highest_rated',
'r_orderby' => 'desc',
'order' => 'DESC'
);
?>
<?php endif; ?>
を。
それの何が問題になっているのですか?
ディスプレイ(ビュー)にアプリケーションロジックを混在させないでください。それは*醜いです* –
@alexchencoなぜ私はdownvotedになったのですか? – alexchenco
@yi_H表示しますか?あなたは次のようなものを意味しますか? '以下は、タグ付きのトピックのリストです '? – alexchenco