2013-10-15 2 views
0

특정 카테고리의 게시물 (이 경우 카테고리 33 (자습서))을 표시하는 페이지가 있고이 카테고리의 게시물에 제목, 게시물 발췌 및 퍼머 링크를 출력합니다.Wordpress : 게시물에 댓글이 허용되었습니다.

<?php $top_query = new WP_Query('cat=33'); ?> 
<?php while($top_query->have_posts()) : $top_query->the_post(); ?> 

어떻게 반환 된 게시물은 댓글이 활성화 된 게시물이어야한다고 지정할 수 있습니까? 나는 그것을 포장 시도했다 :

+0

이것을 확인하십시오 : http://wordpress.org/support/topic/check-if-post-comment-is-enabled-or-not –

답변

1

이 하나

<?php if(have_posts()): ?> 
     <?php while(have_posts()): the_post();?> 
        <?php if(comments_open()){ ?> 
        <div class="news-row"> 
        <?php if (has_post_thumbnail($post->ID)): ?> 
         <div class="newsimagebox"> 
          <?php //$feat_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'thumbnail'); 
           $images = the_post_thumbnail();?> 
          <?php echo $images;?> 
         </div> 
        <?php endif; ?> 
        <div class="news-content"> 
        <h5><?php the_title(); ?></h5>    
        <p><?php the_excerpt();?></p> 
        <div class="readmore"><a href="<?php echo get_permalink(); ?>" title="Read More">Read More</a></div> 
       </div> 
      </div> 
        <?php } ?> 
     <?php endwhile;?> 
<?php endif; //wp_reset_query(); ?> 

감사를하려고 사전에 루프 :(내

감사를 사용할 필요

<?php if(comments_open()) : ?> 

호버

관련 문제