Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // 1. Crear la funcion dentro del archivo FUNCTIONS.PHP (si el mismo no existe, lo creamos)
- // Paginador
- function paginate()
- {
- global $wp_query, $post;
- $big = 999999999; // need an unlikely integer
- if (is_single())
- {
- echo '<div class="alignleft">';
- previous_post_link('%link', '« Anterior');
- echo '</div>';
- echo '<div class="alignright">';
- next_post_link('%link', 'Siguiente »');
- echo '</div><div class="clear"></div>';
- }
- else
- {
- echo 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
- ) );
- }
- }
- // 2. Ubicar la funcion <?php paginate() ?> donde queramos que aparezca el paginador
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement