Simple Page Navigation for wordpress

Admin Option:

Text For Next Post : Next %CURRENT_PAGE% to %TOTAL_PAGES% »

Text For Previous Post :« Previous %PRE_PAGE% to %CURRENT_PAGE%

No.of Pages to Show :0

No.of Larger page page numbers to show:0

WP-PageNavi.php

Search and remove the following codes.

echo ‘<span>’.$pages_text.'</span>’;

echo ‘<span>’.$pagenavi_options[‘dotleft_text’].'</span>’;

echo ‘<a href=”‘.clean_url(get_pagenum_link()).'” title=”‘.$first_page_text.'”>’.$first_page_text.'</a>’;

echo ‘<span>’.$pagenavi_options[‘dotright_text’].'</span>’;

echo ‘<a href=”‘.clean_url(get_pagenum_link($max_page)).'” title=”‘.$last_page_text.'”>’.$last_page_text.'</a>’;

Replace the next_posts_link( next_posts_link($pagenavi_options[‘next_text’], $max_page);) as follow as

$next_pagetxt=($paged*10)+1;
$pages_text2 = str_replace(“%CURRENT_PAGE%”, number_format_i18n($next_pagetxt), $pagenavi_options[‘next_text’]);
$pages_text2 = str_replace(“%TOTAL_PAGES%”, number_format_i18n((($paged+1)*10)), $pages_text2);
next_posts_link($pages_text2, $max_page);

Replace the next_posts_link( previous_posts_link($pagenavi_options[‘prev_text’]);) as follow as

$pre_pagetxt=(($paged-1)*10)-9;
$pages_text1 = str_replace(“%PRE_PAGE%”, number_format_i18n($pre_pagetxt), $pagenavi_options[‘prev_text’]);
$pages_text2 = str_replace(“%CURRENT_PAGE%”, number_format_i18n((($paged-1)*10)), $pages_text1);
previous_posts_link($pages_text2);

Style sheet

/*navigation*/

.navigation{

width:100%;

overflow:hidden;

text-align: center;

margin:10px 0;

font-size:1.1em;

line-height:1.5em;

}

.navigation a{

color:#000;

}

#content .wp-pagenavi{

float:left;

width:100%;

}

a.previouspostslink {float:left;margin:0}

a.nextpostslink {float:right;margin:0}

#content .wp-pagenavi a {

padding: 4px;

color:#000;

background: url(http://ossbooks.com/wp/wp-content/uploads/2010/03/buttonblue.png);

border:1px solid #9AAFE5;

}

#content .wp-pagenavi a:hover{

color:#000;

border:1px solid #2E6AB1;

}

#content .wp-pagenavi span.pages {

padding: 4px;

margin: 2px;

border:0;

border:1px solid #2E6AB1;

}

#content .wp-pagenavi span.current {

display:none;

}

#content .wp-pagenavi span.extend {

}

Demo

Advertisements

2 Responses to “Simple Page Navigation for wordpress”

  1. Eef Says:

    sounds great!
    But how does it look like?
    can you add a demo or any kind of visual?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: