Created
June 23, 2015 14:37
-
-
Save jandrodev/f8baea6337a56d0206d0 to your computer and use it in GitHub Desktop.
Paginador de posts
This file contains hidden or 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
function post_prev_next() { | |
echo '<div class="paginador">'; | |
$prev_post = get_previous_post(); | |
if ( !empty( $prev_post ) ) : | |
echo '<div class="post-prev"> | |
<a href="'; echo get_permalink( $prev_post->ID ); echo '">Anterior</a> | |
</div>'; | |
endif; | |
$next_post = get_next_post(); | |
if ( !empty( $next_post ) ) : | |
echo '<div class="post-next"> | |
<a href="'; echo get_permalink( $next_post->ID ); echo '">Siguiente</a> | |
</div>'; | |
endif; | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment