Famous WordPress loop: get_posts

Lesson#7 of 13 in project Theory

[[youtube]]


$posts = get_posts();

foreach ($posts as $post) {
  echo $post->post_title;
  echo $post->post_content;
  echo $post->post_date;
  echo '<a href="' . get_permalink($post) . '">' . "Read more" . '</a>';
}


See code examples in the docs