0
특정 카테고리의 글에 대한 커스텀 코멘트 포맷을 요청한 클라이언트 사이트가 있습니다. 내 루프 템플릿에서Wordpress 커스텀 코멘트
, 나는이있다 :
<div id="gallery-commentlist">
<ul class="gallery-commentlist">
<?php wp_list_comments('type=comment&callback=gallery_comment'); ?>
</ul>
</div><!-- #gallery-commentlist -->
그리고 내 functions.php 파일을,이 있습니다
<?php function gallery_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="gallery-comment-body">
<p><span class="gallery-comment-author"><?php comment_text() ?>:</span> <?php comment_text() ?></p>
</div>
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)) ?>"> –
<?php get_comment_date() ?> at <?php get_comment_time() ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?>
</div>
</div>
<?php }?>
그것은 어떤 의견을 돌려, 그리고 삶에 대한 아니에요 나, 왜 그런지 모르겠다. 나는 편지에 WP 코덱스의 지침을 따랐다. 간과 한 것이 있습니까?
도움 주셔서 감사합니다.
타이
일부 Wordpress 균열조차 여기에 숨어 있습니다. 이것은 프로그래밍 사이트입니다. [WordPress 포럼에서 WordPress 지원 요청] (http://wordpress.org/support/forum/how-to-and-troubleshooting)을 고려하십시오. – hakre
알아. 문제가 PHP 코드 인 경우 여기에 게시했습니다. –
여기에 콜백을 사용할 때 wordpress가 전달되므로'comment_class()'와 같은 함수가 작동하지 않습니다. 단일 전역 변수를 설정하는 것으로 충분하지 않다고 생각합니다. 그러나 그것은 단지 추측이며, 희망적으로 도움이됩니다. – hakre