Support » Plugin: WP-PageNavi » PageNavi inside single post type

  • Hello,

    I’m using wp-pagenavi inside a single-<postTypeName>.php template.
    The reason why I’m using it inside a single template is that I have two hierarchical related post types.

    Problem: the second page redirect to the first one.

    I use the following query loop:

    function gpc_get_current_theme_fiches( $post_id ) {
        $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
    
        $args = array(
            'posts_per_page' => 10,
            'post_type'      => 'fiche',
            'paged'          => $paged,
            'meta_query'	 => array(
                array(
                    'key'		=> 'fiche-attachment',
                    'compare'	=> '=',
                    'value'		=> $post_id
                )
            )
        );
    
        $the_query = new WP_Query( $args );
    
        return $the_query;
    }

    I’m also including wp_pagenavi( array( 'query' => $fiches_query ) );.

    Any help is appreciated, thanks.

    • This topic was modified 4 months, 3 weeks ago by  veronq.
    • This topic was modified 4 months, 3 weeks ago by  veronq.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.