Pagination is not working on single-{slug}.php but works fine on page-{slug}.php

You forgot to start a new query. And if you dont use have post on your custom query, you will get the main current query, in your case is your single. $args = array( ‘post_type’ => ‘crew’, ‘posts_per_page’ => 10 ); $your_custom_query = new WP_Query( $args ); // is that you forgot // The Loop … Read more

How do I sort posts with multiple pages

You’re initially submitting a POST request via a form with the sort parameters. When you click links to additional pages, you’re just sending a GET request for the next page without those original POST vars, so they don’t carry over to the additional pages and aren’t picked up by your if(isset($_REQUEST[‘sort’])). Probably the simpler way … Read more

Page navigation doesn’t show when query category

I found a partial workaround. Since the query object in the index.php is the right one I transferred it using serialize to template of choice, in this case category-video.php. In index.php i put on top <?php $s = serialize($wp_query); file_put_contents(‘query’,$s); ?> and in category-video.php I put <?php $u = file_get_contents(‘query’); $wp_the_query = unserialize($u); ?> It’s … Read more

Pagenavi pagination via wp-query in functions.php showing same content for each page

Finally solved this with: function my_filter_where( $where=”” ) { global $wp_query; if (is_array($wp_query->query_vars[‘post_status’])) { if (in_array(‘future’,$wp_query->query_vars[‘post_status’])) { // posts today into the future $where .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘now’)) . “‘”; } } return $where; } add_filter( ‘posts_where’, ‘my_filter_where’ ); And: <?php $wp_query = array( ‘post__not_in’ => array(4269), ‘paged’ => get_query_var(‘paged’), … Read more

WP-PageNavi gives me a 404 when using WP Query

This could be a plugin compatibility problem. Have you tried to disable all plugins and see if that solves the problem? I found this which may also be of help: http://dre.im/if-pages-return-a-404-after-wordpress-3-1-upgrade/ Log in to wp-admin and go to permalinks, click save (this should refresh your permalinks). Check to see if this fixes your permalinks. If … Read more

404 error PageNavi custom type taxonomy | wordpress

Your problem is definitly your custom query. There are a problem or two with your custom query which I will not handle now. You should work through this page (WP_Query) on how to properly construct a custom query Your real issue here is, and the question you must ask youself, is the custom query necessary? … Read more

wp_pagenavi function parameters [closed]

Why do you dont use the default functions from WP. As example the follow class, there you can use. class fb_pagination_example { public function content_nav( $nav_id, $pag_bar = TRUE ) { if ( $GLOBALS[‘wp_query’] -> max_num_pages > 1 ) : ?> <nav id=”<?php echo $nav_id; ?>”> <h1 class=”assistive-text”><?php _e( ‘Post navigation’, WP_BASIS_TXTD ); ?></h1> <?php … Read more