최근 댓글 목록을 작게 만들고 댓글이 배치 된 실제 게시물에 대한 링크를 만들고 싶습니다. 불행히도 comment_permalink
또는 post_permalink
이 없으므로 get_permalink()
기능이있을 것이라고 생각했지만 http://codex.wordpress.org/Function_Reference/에서 찾을 수있는 기능은 없습니다.Wordpress 3에서 게시물 ID로 퍼머 링크 가져 오기
$post->ID
만 보아도 특정 게시물에 대한 퍼머 링크를 어떻게 찾을 수 있습니까?
<?php $comments = get_comments(array('status'=>'approve', 'number'=>5)); ?>
<p class="recently-posted-comments">Recent Comments</p>
<ul>
<?php foreach ($comments as $comment): $parent = get_post($comment->comment_post_ID); ?>
<li><?php print $comment->comment_author; ?>
on <?php print $parent->post_title; ?></li>
<?php endforeach; ?>
</ul>
내 의도는 고유 주소로 $parent->post_title
를 변환하는 것입니다 : 그것은 여기 완전히 필요하지만하지 않는 것이 것은 내가 지금까지있는 것입니다.
(이 기능은 [함수 참조]에 열거되지 않았 음을 실망 HTTP 비트 사용 사용 사용 : // 사본 .wordpress.org/Function_Reference /), 실제로 존재한다고 지적 해 주셔서 감사합니다! 그 밖의 내가 누락 된 부분이 있는지 궁금하게 생각합니다. – Aristotle