【发布时间】:2015-12-02 22:00:08
【问题描述】:
我的帖子显示其他帖子的标题时遇到问题,而不仅仅是它独有的单个帖子。其他部分很好,即没有其他重复,只是标题。
我生成内容的代码:
get_header();
$the_query = new WP_Query( 'category_name=careers&showposts=5' );
while ( $the_query->have_posts() ) :
$output = "";
$the_query->the_post();
$output_title .= get_the_title();
$output_content .= get_the_content();
$output_type = get_field('job_type');
$output_salary = get_field('job_salary');
$output_intro = get_field('job_intro');
$careers.= '
<div class="careers">
<h3>'.$output_title.'</h3>
<p class="type">'.$output_type.'</p>
<p class="salary">'.$output_salary.'</p>
<p>'.$output_intro.'</p>
</div>
';
endwhile;
wp_reset_postdata();
所以发生的情况是,最新的帖子显示了一个标题,这很好,但是第二个帖子显示了它的标题 + 最新,第三个职位显示了它的标题 +2+1st。例如:
- 招聘帖1
- 职位发布1职位发布2
- 职位 1 职位 2 职位 3..
什么时候应该:
- 招聘帖1
- 招聘帖2
- 职位发布 3
【问题讨论】: