technically, it does not work, because there is one page extra in the page navigation. as @t31os_ stated, the offset parameter interferes with the page navi.
however, if you have many posts, not many will go to the oldest page of posts, and be confused by a last ’empty’ page.
the code goes into home.php, into the section which you posted earlier yourself.
start with finding the line <!-- News Articles -->
in home.php.
add the first few lines of new code after this.
then add 'offset' => $offset_paged,
further down after 'paged' => $paged,
– that is all.
the result should look like this:
<!-- News Articles -->
<!-- new bit -->
<?php
global $offset;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$offset=4; //enter offset here
$offset_paged = $offset+($paged-1)*( (arras_get_option('index_count') == 0 ? get_option('posts_per_page') : arras_get_option('index_count')) ); ?>
<!-- end of first new bit -->
<?php
$news_query = array(
'cat' => arras_get_option('news_cat'),
'paged' => $paged,
'offset' => $offset_paged,
'showposts' => ( (arras_get_option('index_count') == 0 ? get_option('posts_per_page') : arras_get_option('index_count')) )
);
// if you are a WP plugin freak you can use 'arras_news_query' filter to override the query
((if you use the plugin wp_pagenavi, you can edit wp-pagenavi.php and get rid of the ‘extra’ page in the menu – change here in the lines marked with /////////
:
### Function: Page Navigation: Boxed Style Paging
function wp_pagenavi($before = '', $after = '') {
global $wpdb, $wp_query, $offset; ////////////
if (!is_single()) {
$request = $wp_query->request;
$posts_per_page = intval(get_query_var('posts_per_page'));
$paged = intval(get_query_var('paged'));
$pagenavi_options = get_option('pagenavi_options');
$numposts = $wp_query->found_posts-$offset; ////////////
$max_page=ceil($numposts/$posts_per_page); ///////////////
////// $max_page = $wp_query->max_num_pages; ////////////
if(empty($paged) || $paged == 0) {
$paged = 1;
))