from what I undersrtand wp-Query doesn’t work with static pages
see below
http://wordpress.org/support/topic/wp_query-with-pages?replies=5
wp-Query doesn’t work with static pages
Yes it does!
@benners_: Where did you get that pagination
parameter from?
I’ve made an error thinking pagination() was a WP function as I found what I thought was a reference for it https://codex.wordpress.org/Pagination
This is the function from the parent theme I’m using.
function pagination($pages = '', $range = 4) {
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
if($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if(!$pages) {
$pages = 1;
}
}
if(1 != $pages) {
echo "<span class='allpages'>" . __('Page', 'minti') . " ".$paged." " . __('of', 'minti') . " ".$pages."</span>";
if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« " . __('First', 'minti') . "</a>";
if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ " . __('Previous', 'minti') . "</a>";
for ($i=1; $i <= $pages; $i++) {
if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) {
echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\">".$i."</a>";
}
}
if ($paged < $pages && $showitems < $pages) echo "<a href=\"".get_pagenum_link($paged + 1)."\">" . __('Next', 'minti') . " ›</a>";
if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>" . __('Last', 'minti') . " »</a>";
}
}
You cannot pass that custom function as a parameter to WP_Query.
I’m sorry but as you are using a commercial theme, you need to seek support from the theme’s developer/vendor. We do not support commercial products here.
Try http://mintithemes.com/forums/
OK, thanks for trying to assist. Will try Mintithemes Forum.
In case this helps anyone, the problem was I didn’t include the ‘paged’ parameter and had nothing to do with the custom pagination function I was using.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array (
'post_type' => 'event',
'pagination' => true,
'paged' => $paged,
'order' => 'DESC',
);
global $wp_query;
$wp_query = new WP_Query( $args );
if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post();
// Get content
endwhile;
pagination();
else :
// Not found
endif;