single.php:
<?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 -->
<?php
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.]
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=”http://image142-c.poco.cn/mypoco/myphoto/20130508/06/63788011201305080656372625971814562_001.jpg” />
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=”http://image142-c.poco.cn/mypoco/myphoto/20130508/06/63788011201305080656372625971814562_000.jpg”>
Can I have “Next Previous” links, instead of 12345 links, on the single post page?
Try it with next_post_link() and previous_post_link() (without the ‘s’ ):
http://codex.ww.wp.xz.cn/Function_Reference/next_post_link
http://codex.ww.wp.xz.cn/Template_Tags/previous_post_link
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):
http://codex.ww.wp.xz.cn/Template_Tags/wp_link_pages
Example to show text instead of numbers:
<?php
$args = array(
'next_or_number' => 'next',
'nextpagelink' => __( 'Next page' ),
'previouspagelink' => __( 'Previous page' ),
);
wp_link_pages( $args );
?>
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().