WordPress.org

Ready to get started?Download WordPress

Forums

The Bootstrap
Navigation inside multi-pages posts (1 post)

  1. @vit
    Member
    Posted 1 year ago #

    Hi!
    The Bootstrap 2.2

    the_bootstrap_link_pages not show <previouspagelink> and <nextpagelink> for multipage post.
    may be fix below?

    function the_bootstrap_link_pages( $args = array() ) {
    	wp_link_pages( array( 'echo' => 0 ) );
    	$defaults = array(
    		'next_or_number'   => 'number',
    		'nextpagelink'     => __( 'Next page', 'the-bootstrap' ),
    		'previouspagelink' => __( 'Previous page', 'the-bootstrap' ),
    		'pagelink'         => '%',
    		'echo'             => true
    	);
    
    	$r = wp_parse_args( $args, $defaults );
    	$r = apply_filters( 'the_bootstrap_link_pages_args', $r );
    	extract( $r, EXTR_SKIP );
    
    	global $page, $numpages, $multipage, $more, $pagenow;
    
    	$output = '';
    	if ( $multipage ) {
    		if ( 'number' == $next_or_number ) {
    			$output .= '<nav class=&quot;pagination pagination-small clear&quot;><ul><li><span class=&quot;dots&quot;>' . __( 'Pages:', 'the-bootstrap' ) . '</span></li>';
    			if ( $more ) {
    				$i = $page - 1;
    				if ( $i && $more ) {
    					$output .= '<li>' . _wp_link_page( $i ) . $previouspagelink. '</a></li>';
    				}
    			}
    			for ( $i = 1; $i < ($numpages + 1); $i++ ) {
    				$j = str_replace( '%', $i, $pagelink );
    				if ( ($i != $page) || ((!$more) && ($page!=1)) ) {
    					$output .= '<li>' . _wp_link_page($i) . $j . '</a></li>';
    				}
    				if ($i == $page) {
    					$output .= '<li class=&quot;current&quot;><span>' . $j . '</span></li>';
    				}
    
    			}
    
    			if ( $more ) {
    				$i = $page + 1;
    				if ( $i <= $numpages && $more ) {
    					$output .= '<li>' . _wp_link_page( $i ) . $nextpagelink. '</a></li>';
    				}
    			}
    			$output .= '</ul></nav>';
    		}
    	}
    
    	if ( $echo )
    		echo $output;
    
    	return $output;
    }

    Thanks,
    With Regards

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.