Skip to content

Instantly share code, notes, and snippets.

@usainicola
Created March 12, 2018 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usainicola/998991c3b6c3c87de60413f3ca548a8d to your computer and use it in GitHub Desktop.
Save usainicola/998991c3b6c3c87de60413f3ca548a8d to your computer and use it in GitHub Desktop.
Standard WordPress Loop
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('clr'); ?>>
<?php the_title( '<h1>', '</h1>' ); ?>
<?php the_post_thumbnail(); ?>
<?php echo get_post_meta(get_the_ID(), 'meta_name', true); ?>
<?php the_content(); ?>
</div>
<?php endwhile; else: ?>
<p>Sorry, no posts found</p>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment