Skip to content

Instantly share code, notes, and snippets.

@mariovalney
Created October 9, 2018 18:30
Show Gist options
  • Save mariovalney/601d60cafb71ddec641584d3923ca783 to your computer and use it in GitHub Desktop.
Save mariovalney/601d60cafb71ddec641584d3923ca783 to your computer and use it in GitHub Desktop.
[Sublime Text 3] WordPress Loop Snippet
<snippet>
<content><![CDATA[if ( ${8:\$the_query->}have_posts() ) : ${1:?>
${2:<!-- HTML Before Loop -->}
<?php }while ( ${9:\$the_query->}have_posts() ) : ${10:\$the_query->}the_post(); ?>
${3:<!-- Post Content -->}
<?php endwhile;${4: ?>
${5:<!-- HTML After Loop-->}
<?php }${6:else : ?>
${7:<!-- HTML If No Content-->}
<?php }endif;
wp_reset_postdata();]]></content>
<tabTrigger>loop</tabTrigger>
<description>WP Loop</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment