Created
July 1, 2017 21:08
-
-
Save ericjames/70b34a69b86c87c0f65eea887a3baf0f to your computer and use it in GitHub Desktop.
Wordpress Table of Contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php global $query_string; | |
query_posts ( $query_string . '&posts_per_page=5&offset=0'); ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<li><a href="#post-<?php the_ID(); ?>" title="Read <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br /> | |
<span><?php the_time('n/j/y')?></span> - <span><?php the_author() ?></span> - <?php the_tags( '<span>', ', ', '</span>'); ?> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
<ul> | |
<?php global $query_string; | |
query_posts ( $query_string . '&posts_per_page=5&offset=5'); ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<li><a href="#post-<?php the_ID(); ?>" title="Read <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br /> | |
<span><?php the_time('n/j/y')?></span> - <span><?php the_author() ?></span> - <?php the_tags( '<span>', ', ', '</span>'); ?> | |
</li> | |
<?php endwhile; wp_reset_query(); ?> | |
</ul> | |
<?php if(class_exists('wp_pagination_plugin')){ | |
$p = new wp_pagination_plugin; | |
$p->nextIcon('→'); // changing the icon 'next' | |
$p->prevIcon('←'); // changing the previous 'icon' | |
$p->show(); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment