我在wordpress中为页面的子页面制作了一个模板。问题是disqus评论只出现在第一个子页面下。例如工作正常,但其余页面显示默认的wordpress注释。如果我改变了第一页的ID,那么它就可以在那个特定的页面上工作,但不能在其他页面上工作。我认为它与我输入php代码的方式有关。
<?php
/**
* @package WordPress
* @subpackage DID
*/
/*
Template Name: Season 4 - Contestant
*/
get_header(); ?>
<div id="leftColumn" style="width:98%;"><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="grid">
<?php if (is_page(5503)) { ?>
<ul class="contestant-performance">
<?php if($results = lpcf_raw_output( array('field' => 'performer_id', 'having' => 'performer_id,401', 'orderby' => 'cfvalue:episode', 'order' => 'ASC'))) { foreach($results as $post) { ?>
<li>
<a href="<?php echo $post->permalink ?>" title="<?php echo $post->post_title ?>"><img src="<?php echo get_field('image_facebook'); ?>" /></a>
<h2><?php echo $post->title ?></h2>
</li>
<?php } } ?>
</ul>
<?php } ?>
<?php if (is_page(5514)) { ?>
<ul class="contestant-performance">
<?php if($results = lpcf_raw_output( array('field' => 'performer_id', 'having' => 'performer_id,402', 'orderby' => 'cfvalue:episode', 'order' => 'ASC'))) { foreach($results as $post) { ?>
<li>
<a href="<?php echo $post->permalink ?>" title="<?php echo $post->post_title ?>"><img src="<?php echo get_field('image_facebook'); ?>" /></a>
<h2><?php echo $post->title ?></h2>
</li>
<?php } } ?>
</ul>
<?php } ?>
</div>
<div class="clear"> </div>
<?php comments_template(); ?>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>