Skip to content

Instantly share code, notes, and snippets.

@jarretc
Created August 31, 2012 03:35
Show Gist options
  • Save jarretc/3548761 to your computer and use it in GitHub Desktop.
Save jarretc/3548761 to your computer and use it in GitHub Desktop.
function jc_paged_posts_columns() {
echo '<div id="paged-columns">';
global $post;
$numposts = 11;
$args = array( 'numberposts' => $numposts, 'offset' => 10 );
$column1 = get_posts( $args );
echo '<ul class="column-list">';
echo '<li class="column-heading">Page 2</li><ol>';
foreach ( $column1 as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach;
echo '</ol></ul>';
$args = array( 'numberposts' => $numposts, 'offset' => 21 );
$column2 = get_posts( $args );
echo '<ul class="column-list">';
echo '<li class="column-heading">Page 3</li><ol>';
foreach ( $column2 as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach;
echo '</ol></ul>';
$args = array( 'numberposts' => $numposts, 'offset' => 32 );
$column3 = get_posts( $args );
echo '<ul class="column-list">';
echo '<li class="column-heading">Page 4</li><ol>';
foreach ( $column3 as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach;
echo '</ol></ul>';
echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment