diff options
| author | Max | 2019-03-06 19:15:01 +0100 |
|---|---|---|
| committer | Max | 2019-03-06 19:15:01 +0100 |
| commit | af937d3250f423005eace057e3125f177a511fc1 (patch) | |
| tree | e79fea068426a85a4e3fee38411dba0c4a2bf4a4 /inc/extras.php | |
| parent | 7be5ee6e58c66053d75afeeb362ed4d5c75b74eb (diff) | |
| download | fuselkoenig_de-af937d3250f423005eace057e3125f177a511fc1.tar.gz | |
Pagination can be limited to current taxonomy.
Diffstat (limited to 'inc/extras.php')
| -rw-r--r-- | inc/extras.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/extras.php b/inc/extras.php index 94f7485..4ad648c 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -85,7 +85,7 @@ if ( ! function_exists( 'understrap_change_logo_class' ) ) { */ if ( ! function_exists ( 'understrap_post_nav' ) ) { - function understrap_post_nav() { + function understrap_post_nav($taxonomy = '') { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); @@ -100,10 +100,18 @@ if ( ! function_exists ( 'understrap_post_nav' ) ) { <?php if ( get_previous_post_link() ) { - previous_post_link( '<span class="col nav-previous text-left">%link</span>', _x( '<i class="fa fa-angle-left"></i> %title', 'Previous post link', 'understrap' ) ); + if ( '' != $taxonomy ) { + previous_post_link( '<span class="col nav-previous text-left">%link</span>', _x( '<i class="fa fa-angle-left"></i> %title', 'Previous post link', 'understrap' ), true, '', $taxonomy ); + } else { + previous_post_link( '<span class="col nav-previous text-left">%link</span>', _x( '<i class="fa fa-angle-left"></i> %title', 'Previous post link', 'understrap' ) ); + } } if ( get_next_post_link() ) { - next_post_link( '<span class="col nav-next text-right">%link</span>', _x( '%title <i class="fa fa-angle-right"></i>', 'Next post link', 'understrap' ) ); + if ( '' != $taxonomy ) { + next_post_link( '<span class="col nav-next text-right">%link</span>', _x( '%title <i class="fa fa-angle-right"></i>', 'Next post link', 'understrap' ), true, '', $taxonomy ); + } else { + next_post_link( '<span class="col nav-next text-right">%link</span>', _x( '%title <i class="fa fa-angle-right"></i>', 'Next post link', 'understrap' ) ); + } } ?> </div><!-- .nav-links --> |
