WP Query with offset breaks wp_pagenavi or any pagination
I am working on a custom loop using WP_Query using the offset parameter. The problem is that as soon as I add the offset, it breaks the pagination, displaying the same links no matter the page number.
?php
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$query_args = array(
'post_type' = 'notice',
'posts_per_page' = 6,
'offset' = 1,
'paged' = $paged
);
$the_query = new WP_Query( $query_args );
?
?php if ( $the_query-have_posts() ) : ?
?php while ( $the_query-have_posts() ) : $the_query-the_post(); ?
h3a href="?php the_permalink(); ?"?php the_title() ?/a/h3
?php endwhile; ?
?php wp_pagenavi( array( 'query' = $the_query ) ); ?
?php endif; ?
I tried following the code here:
https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
But adding this code to my theme breaks any related queries.
Any ideas on how I could make this work?
Topic offsets wp-query pagination Wordpress
Category Web