Skip to content

Instantly share code, notes, and snippets.

@YoshinoriKobayashi
Last active August 29, 2015 13:56
Show Gist options
  • Save YoshinoriKobayashi/9136313 to your computer and use it in GitHub Desktop.
Save YoshinoriKobayashi/9136313 to your computer and use it in GitHub Desktop.
WordPress Main Loop while loop have_posts()
<?php
// have_posts 次の投稿が存在すれば、true
// http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/have_posts
// the_post() 記事情報の変数設定
// http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/the_post
while (have_posts()) : the_post():
get_template_part('content');
endwhile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment