【发布时间】:2010-12-18 20:05:35
【问题描述】:
我的 wordpress 网站中有这个循环,它显示带有标题的最新帖子,我想在标题之后显示帖子内容。我通常使用函数 get_the_content 检索它,但我会以各种方式破坏整个页面,我对 php 非常陌生,并且不知道如何将任何内容添加到循环中。这是循环:
while ( $q_query->have_posts() )
{
$q_query->next_post();
$question = get_post($q_query->post);
$loophtml = $loophtml . "<li><span class='list-question-title'>" . "<a class='list-answer-link' href='" . get_permalink($question->ID) ."'>" . $question->post_title . "</a></span>";
$loophtml = $loophtml . "<span class='list-number-answers'>" . get_comments_number($question->ID) . " comentarios</span> · <a href='" . get_permalink($question->ID) ."'>Comentar</a>";
$loophtml = $loophtml . "</li>";
}
有人知道我如何在某处添加内容吗?谢谢
【问题讨论】:
-
详细说明“无法使其工作”。怎么了? (或者考虑在wordpress.stackexchange.com上发帖)