wordpressランダム投稿プラグイン用のこのphpコードがあります:
<?php
global $post;
$tmp_post = $post;
$args = array( 'numberposts' => 5, 'orderby' => 'rand', 'post_status' => 'publish', 'offset' => 1);
$rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<li><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2><p><?php the_excerpt(); ?>
</p></li>
<?php endforeach; ?>
</ul>
<?php $post = $tmp_post; // reset the $post to the original ?>
コードの意味を知りたい.私は'offset' => 1
すでに次のような他の人に理解しています:
- Numberpost - 何件の投稿を表示したいですか?
- Orderby – ブログ記事のリストからランダムに選択します。
- Post_status – 公開ステータスのブログ投稿のみを選択します。
- オフセット - ???
誰かが私のためにこれを定義できますか.