Skip to content

Instantly share code, notes, and snippets.

@ville6000
Last active October 22, 2015 08:27
Show Gist options
  • Save ville6000/07fff6b6572ef0275380 to your computer and use it in GitHub Desktop.
Save ville6000/07fff6b6572ef0275380 to your computer and use it in GitHub Desktop.
Variable demo 2
<?php
$post_idx = 0;
if ( have_posts()) {
while ( have_posts()) {
the_post();
// $post_idx is available in content-page.php
include( locate_template( 'content-page.php' ) )
$post_idx += 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment