summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax2019-03-06 19:15:01 +0100
committerMax2019-03-06 19:15:01 +0100
commitaf937d3250f423005eace057e3125f177a511fc1 (patch)
treee79fea068426a85a4e3fee38411dba0c4a2bf4a4
parent7be5ee6e58c66053d75afeeb362ed4d5c75b74eb (diff)
downloadfuselkoenig_de-af937d3250f423005eace057e3125f177a511fc1.tar.gz
Pagination can be limited to current taxonomy.
-rw-r--r--inc/extras.php14
-rw-r--r--single-angebote.php2
2 files changed, 12 insertions, 4 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>&nbsp;%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>&nbsp;%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>&nbsp;%title', 'Previous post link', 'understrap' ) );
+ }
}
if ( get_next_post_link() ) {
- next_post_link( '<span class="col nav-next text-right">%link</span>', _x( '%title&nbsp;<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&nbsp;<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&nbsp;<i class="fa fa-angle-right"></i>', 'Next post link', 'understrap' ) );
+ }
}
?>
</div><!-- .nav-links -->
diff --git a/single-angebote.php b/single-angebote.php
index 1182b5d..2b0bfb6 100644
--- a/single-angebote.php
+++ b/single-angebote.php
@@ -28,7 +28,7 @@ $container = get_theme_mod( 'understrap_container_type' );
<?php get_template_part( 'loop-templates/content', 'angebote' ); ?>
- <?php understrap_post_nav(); ?>
+ <?php understrap_post_nav( 'type' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template.