워드프레스 댓글 많이 달린 순서대로 표시

https://avada.tistory.com/2544 

 

저 소스를 펑션에 추가하였더니 전체 댓글이 각 게시글에 나오더라구요

각게시글의 댓글만 보여지게 하고싶은데 저소스를 튜닝할수있을까요ㅠㅠ

/ 댓글이 많이 달린 글 표시하기 function wp_most_commented_posts() { // start output buffering ob_start(); ?> <ol class="most-commented"> <?php // WP_Query 실행 // 표시할 글 개수 $query = new WP_Query('orderby=comment_count&posts_per_page=10'); // 루프 시작 while ($query->have_posts()) : $query->the_post(); ?> <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<span class="wpb-comment-count"><?php comments_popup_link('댓글 없음', '1', '%'); ?></span>)</li> <?php endwhile; // 루프 종료 ?> </ol> <?php // 아웃풋 버퍼링 끄기 $output = ob_get_clean(); // 출력 반환 return $output; } // 숏코드 생성 add_shortcode('wp_most_commented', 'wp_most_commented_posts');

 

저 소스에서 어느부분을 수정해야 전체 댓글이 각 게시글에 안보여지고 그글의 댓글만 각각 나오게 가능한지 아시면 부탁드려요ㅠㅠ  

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요