나는 wordpress를 사용하는 법을 배우려하고있다. 댓글 레이아웃을 변경하려고하고 댓글 날짜에 참여하여 작성자 데이터에 댓글을 달려고합니다. 그러나 나는 그것을 얻지 못하고있다. 예를 들어 첫 번째 이미지에는 무엇이 있지만 두 번째 이미지에 원하고 있습니다. 제발 도와 줄 수있어? 정말 고마워! 덧글 작성 날짜 덧글 div 작성자 Wordpress
0
A
답변
1
나는 당신의 주요 문제는 당신이 날짜에만 CSS를 사용하여 배치되는 방식을 사용자 정의 할 수 있지만 매우 어려운 것으로 생각합니다. 가장 좋은 방법은 나만의 맞춤 의견 코드를 작성하는 것입니다.
Wordpress는 여러분의 의견을 말씀해주십시오.
wp_list_comments(array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 42,
));
당신은 같은 것을 수행 할 수 있습니다 :
<ol class="commentlist">
<?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>
</ol>
을 그리고 당신이를 추가 할 수 function.php 파일에이 일을 대신 주석 템플릿 코드를 호출 예를 들어
mytheme_comment 함수는 wp가 가지고있는 원래 주석 코드를 가지고 클래스와 html 코드 배치를 재 배열하여 원하는 날짜를 가질 수 있습니다.
function mytheme_comment($comment, $args, $depth) {
if ('div' === $args['style']) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
<<?php echo $tag ?> <?php comment_class(empty($args['has_children']) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
<?php if ('div' != $args['style']) : ?>
<div id="div-comment-<?php comment_ID() ?>" class="comment-body">
<?php endif; ?>
<div class="comment-author vcard">
<?php if ($args['avatar_size'] != 0) echo get_avatar($comment, $args['avatar_size']); ?>
<?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()); ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.'); ?></em>
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>">
<?php
/* translators: 1: date, 2: time */
printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()); ?></a><?php edit_comment_link(__('(Edit)'), ' ', '');
?>
</div>
<?php comment_text(); ?>
<div class="reply">
<?php comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
</div>
<?php if ('div' != $args['style']) : ?>
</div>
<?php endif; ?>
<?php
}
는 기본 코드에서 당신은 코드를 볼 수 있습니다
<?php
/* translators: 1: date, 2: time */
printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
?>
는 당신에게 최신의 정보를 제공하는 것이다.
당신이 이것을 이해했기를 바랍니다. wp list comments
+1
내 문제는 내가 주석 기본 코드를 찾지 못했지만, 확실히 작동합니다. 정말 고마워. –
관련 문제
- 1. Facebook 덧글 - wordpress
- 2. Wordpress 답글 덧글 Link
- 3. 덧글 언제 덧글 추가
- 4. vba word 덧글 및 작성자
- 5. 덧글 Django의 다른 덧글
- 6. React Tutorial - 덧글 추가 후 덧글 추가
- 7. rails blog 덧글 덧글 덧글 덧글 Add active admin 로그인 페이지
- 8. wordpress 함수에서 덧글 URL을 추출
- 9. Facebook-WordPress 덧글/피드백 통합
- 10. Facebook 덧글 수 clickable
- 11. PHP - 덧글
- 12. FeedBurner에 덧글 수 추가
- 13. javascript 덧글 및 문서
- 14. jquery 선택한 덧글 삭제
- 15. drupal 덧글 모듈
- 16. fb : javascript로 덧글 삽입
- 17. drupal auto width의 덧글
- 18. Facebook 덧글 플러그인이 로딩되지 않습니다.
- 19. PHP, Facebook 덧글
- 20. 덧글 시스템 재 게시 페이지 재로드에 대한 덧글
- 21. CakePHP의 기사에 덧글 추가
- 22. 기사의 덧글 페이지 (/ a/2/comments /)에 django 덧글 사용
- 23. 적은 자동 복수 행 덧글
- 24. 끝 haml 덧글
- 25. Facebook 덧글 문제
- 26. Facebook 덧글 api phonegap
- 27. Django 덧글 표시
- 28. VBA 매크로 단어 덧글
- 29. checkintool에 덧글 추가
- 30. HighCharts 덧글 추가
당신은 어떤 게시물의 루프 코멘트 날짜를 원하는 :
다음은이에 대한 원래의 WP 설명서입니까? – Coder
모든 코멘트에 날짜가 필요합니다. 나는 그 위치를 바꾸고 싶지만 그것이 어디에 있는지를 알지 못한다. 나는 worpress가 나를 위해 그것을 창조한다고 생각한다. –
그 링크를 보내 주시겠습니까? – Coder