반응형
WordPress의 첫 번째 게시물을 건너뛸 수 있는 방법은 무엇입니까?
WordPress의 첫 번째 게시물을 건너뛸 수 있는 방법은 무엇입니까?
<?php
$recentPosts = new WP_Query();
$recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
다음 파라미터를 사용합니다.
<?php
$recentPosts = new WP_Query( 'offset=1' ) );
$recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
오프셋 사용
$recentPosts = new WP_Query (
array(
'post_type' => 'stiri',
'post_status' => 'publish',
'posts_per_page' => 6, // all = -1
'orderby' => 'date',
'order' => 'DESC',
'offset' => 1
)
);
언급URL : https://stackoverflow.com/questions/11697427/how-can-i-skip-the-first-post-in-wordpress
반응형
'bestsource' 카테고리의 다른 글
복수의 콜에 대해서 복수의 인수를 체크하려면 어떻게 해야 합니까? (0) | 2023.02.09 |
---|---|
Spring Boot 2.0 응용 프로그램이 schema.sql을 실행하지 않는 이유는 무엇입니까? (0) | 2023.02.09 |
if/else 뒤에 사용할 "let" 또는 "const"를 선언하려면 if/else를 사용하십시오. (0) | 2023.02.09 |
ReactJs에서 null 프로펠러 유형을 지정하는 방법 (0) | 2023.02.09 |
wordpress 및 node.displaces.displaces 입니다. (0) | 2023.02.09 |