-4
더 많은 게시물이 있더라도 결과가 10 개만 표시되는 이유는 무엇입니까?페이지에 표시되는 게시 결과 수를 변경하는 방법
<div class="job-cont">
\t \t <?php
\t \t $query = new WP_Query(array('post_type' => 'jobs'));
\t \t \t if ($query->have_posts()) :
\t \t \t \t while ($query->have_posts()) : $query->the_post(); ?>
\t \t \t \t <div class="title_image_container">
\t \t \t <a href="<?php the_permalink(); ?>">
\t \t \t <h1 class="the_job_title"><?php the_title(); ?></h1>
\t \t \t <img class="the_job_image" src="<?php the_post_thumbnail();?>
\t \t \t </a>
\t \t \t \t </div>
\t \t \t <?php endwhile;
\t \t \t endif;
\t \t ?>
\t \t
\t \t </div>
그것은 내가 페이지에 보여 싶은 게시물의 수를 변경하는 방법이 ?
나는 모든이 일을하려고 준비했지만 아직 결과가없는 :
function number_of_posts_per_page($number) {
if (is_home()) {
$number->set('posts_per_page', 15);
}
add_action('pre_get_posts', 'number_of_posts_per_page');
무엇? 좀 더 자세한 내용을 말하면서 당신이 말하는 바가 무엇인지 모릅니다 – user5014677
예. 죄송합니다. 지금 이해하는 것이 좋습니다. – Caesar