Moin moin,
ich habe ein Problem mit meinem Template.
Ich musst für das Theme eine statische Seite aktivieren und nun funktioniert der Link "Older Posts" nicht mehr. :(
Hat jemand eine Idee woran es liegen könnte?
PHP
if ( ! function_exists( 'rey_paging_nav' ) ) :/**
* Display navigation to next/previous set of posts when applicable.
*/
function rey_paging_nav() {
// Don't print empty markup if there's only one page.
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
?>
<nav class="navigation paging-navigation clearfix" role="navigation">
<div class="full">
<h5 class="screen-reader-text"><?php _e( 'Posts navigation', 'rey' ); ?></h5>
<div class="nav-links">
<?php if ( get_next_posts_link() ) : ?>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav"><i class="fa fa-long-arrow-left"></i></span> Older posts', 'rey' ) ); ?></div>
<?php endif; ?>
<?php if ( get_previous_posts_link() ) : ?>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav"><i class="fa fa-long-arrow-right"></i></span>', 'rey' ) ); ?></div>
<?php endif; ?>
</div><!-- .nav-links -->
</div>
</nav><!-- .navigation -->
<?php
}
endif;
if ( ! function_exists( 'rey_post_nav' ) ) :
/**
* Display navigation to next/previous post when applicable.
*/
function rey_post_nav() {
// 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 );
if ( ! $next && ! $previous ) {
return;
}
?>
<nav class="navigation post-navigation clearfix" role="navigation">
<h5 class="screen-reader-text"><?php _e( 'Post navigation', 'rey' ); ?></h5>
<div class="nav-links">
<?php
previous_post_link( '<div class="nav-previous">%link</div>', _x( '<span class="meta-nav"><i class="fa fa-long-arrow-left"></i></span> %title', 'Previous post link', 'rey' ) );
next_post_link( '<div class="nav-next">%link</div>', _x( '%title <span class="meta-nav"><i class="fa fa-long-arrow-right"></i></span>', 'Next post link', 'rey' ) );
?>
</div><!-- .nav-links -->
</nav><!-- .navigation -->
<?php
}
endif;
Alles anzeigen