Support » Theme: Magazine Basic » can't find 'wp_link_pages() function' in magazine basic

  • numerous attempts, but just can’t change the pagination to be looking like this: ‘previous page’ ‘next page’, instead of the current pagination showing all pages numbers like: Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13….

    I tried many codes on the internet to accomplish this, and installed the plug-in wp-navi,but all failed.

    could anyone show me the way how to do it in the theme of magazine basic?

Viewing 5 replies - 1 through 5 (of 5 total)
  • single.php:

     * The Template for displaying all single posts.
     * @since 3.0.0
    get_header(); ?>
    	<div id="primary" <?php mb_primary_attr(); ?> role="main">
    		<?php while ( have_posts() ) : the_post();
    	    	global $mb_content_area;
    	    	$mb_content_area = 'main';
    	    	get_template_part( 'content', get_post_format() );
    			<div id="posts-pagination">
    				<h3 class="assistive-text"><?php _e( 'Post navigation', 'magazine-basic' ); ?></h3>
    				<div class="previous fl"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> %title', 'magazine-basic' ) ); ?></div>
    				<div class="next fr"><?php next_post_link( '%link', __( '%title <span class="meta-nav">→</span>', 'magazine-basic' ) ); ?></div>
    			</div><!-- #posts-pagination -->
    			if ( 'attachment' != get_post_type( get_the_ID() ) )
    			     comments_template( '', true );
    		<?php endwhile; // end of the loop. ?>
    	</div><!-- #primary.c8 -->
    <?php get_footer(); ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Moderator bcworkz


    First of all, deactivate wp_pagenavi, that is what is generating the 12345 links. Then, on your theme’s index.php, replace either wp_pagenavi(); and/or mb_pagination(); (line 75 in the default distribution) or anything else you placed that is generating pagination links, with the following:

    next_posts_link('next page');
    previous_posts_link('previous page');

    Ensure the code is wrapped in a <?php ?> block. You’ll probably need to add styling to get the links to appear where you want.

    thanks for the help, I deactivated wp_pagenavi, and after replacing either wp_pagenavi(); and/or mb_pagination(); with

    next_posts_link('next page');
    previous_posts_link('previous page');

    I get this:
    <img src=”” />

    Actually, my problem is that in a long single post (not the index page), I used the <!–nextpage–> quicktag to divide it into multiple pages, and the pagination looks like this:

    <img src=””>

    Can I have “Next Previous” links, instead of 12345 links, on the single post page?

    Moderator keesiemeijer



    Try it with next_post_link() and previous_post_link() (without the ‘s’ ):

    Use the functions after: <?php endwhile; // end of the loop. ?>

    If you want to show pagenumbers or text for a post that is divided by ‘<!–nextpage–>’ you can use wp_link_pages() inside the loop (before the endwhile):
    Example to show text instead of numbers:

    $args = array(
    	'next_or_number'   => 'next',
    	'nextpagelink'     => __( 'Next page' ),
    	'previouspagelink' => __( 'Previous page' ),
    wp_link_pages( $args );

    Theme Author c.bavota


    Open up content-footer.php and you will find wp_link_pages(). The issue you are encountering is due to the fact that your posts are split up into too many sub-pages. Both nav function suggested above are to go to the next or previous post. The only function that exists to switch pages within a single post is wp_link_pages().

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘can't find 'wp_link_pages() function' in magazine basic’ is closed to new replies.