Title: Implement in framework
Last modified: August 21, 2016

---

# Implement in framework

 *  [FreelanceCreatief](https://wordpress.org/support/users/jaspergrafisch/)
 * (@jaspergrafisch)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/implement-in-framework/)
 * Hi there,
 * My framework has a (for me) complex code. Anybody know how to implement the wp-
   paginate code?
    :
 *     ```
       function xtreme_post_pagination() {
       	global $wp_query;
       	$options = get_option( XF_OPTIONS );
           $start = '<div class="pagination">';
           $end = '</div>';
           if ( xtreme_is_html5() ) {
               $start = '<nav class="pagination">';
               $end = '</nav>';
           }
           echo $start;
       	if (!isset($options['xc_pagination']) || $options['xc_pagination']['pagination_type']['value'] != 1) : ?>
           <div class="previous_link"><?php previous_posts_link(__('Newer Posts <span>→</span>', XF_TEXTDOMAIN)) ?></div>
           <div class="next_link"><?php next_posts_link(__('<span>←</span> Older Posts', XF_TEXTDOMAIN)) ?></div>
           <?php else: ?>
       	<?php
       		$type = (isset($options['xc_pagination']['type']['value']) ? $options['xc_pagination']['type']['value'] : 'plain');
       		$big = 999999999; // need an unlikely integer
       		$page_links = paginate_links( array(
       			'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
       			'format' => '?paged=%#%',
       			'current' => max( 1, get_query_var('paged') ),
       			'total' => $wp_query->max_num_pages,
       			'end_size' => (isset($options['xc_pagination']['end_size']['value']) ? (int)$options['xc_pagination']['end_size']['value'] : 1),
       			'mid_size' => (isset($options['xc_pagination']['mid_size']['value']) ? (int)$options['xc_pagination']['mid_size']['value'] : 2),
       			'show_all' => (isset($options['xc_pagination']['show_all']['value']) ? (bool)$options['xc_pagination']['show_all']['value'] : false),
       			'prev_next' => (isset($options['xc_pagination']['prev_next']['value']) ? (bool)$options['xc_pagination']['prev_next']['value']: true),
       			'type' => 'array'
       		) );
       		$page_links = apply_filters( 'xtreme_post_pagination', $page_links);
       		if (is_array($page_links)) {
       			switch($type) {
       				case 'list':
       					$r .= "<ul class='page-numbers'>\n\t<li>";
       					$r .= join("</li>\n\t<li>", $page_links);
       					$r .= "</li>\n</ul>\n";
       					break;
       				default:
       					$r = join("\n", $page_links);
       					break;
       			}
       		}else $r = (string)$page_links;
       		echo $r;
       	?>
       	<?php endif;
       	echo $end;
       }
       ```
   
 * Best Regards,
    Jasper.
 * [http://wordpress.org/extend/plugins/wp-paginate/](http://wordpress.org/extend/plugins/wp-paginate/)

The topic ‘Implement in framework’ is closed to new replies.

 * ![](https://ps.w.org/wp-paginate/assets/icon-128x128.png?rev=1566512)
 * [WP-Paginate](https://wordpress.org/plugins/wp-paginate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-paginate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-paginate/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-paginate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-paginate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-paginate/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [FreelanceCreatief](https://wordpress.org/support/users/jaspergrafisch/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/implement-in-framework/)
 * Status: not resolved