WP_pagenavi with list author get_user not work modele page

Question

Hello I realized with a page template, the list of contributor of a website. That works well. But I can not put a pagniation with the plugin wp_pagenavi. Here is the code I added with this plugin. From here I use it for my archive.php page of my custom post type. But for this case I can’t find the solution.

Do you have a solution?

            <?php $paged = get_query_var('paged') ? get_query_var('paged') : 1;?>
            <?php $contributor_member = array(
                 'role'    => 'Contributor',
                 'orderby' => 'user_nicename',
                 'order'   => 'ASC',
                 'number'  => 2,
            );?>
            <?php $authors = get_users($contributor_member);
                foreach ($authors as $users):?>
                        <div class="column-member">
                            <div class="info-member">
                                <span class="comite-description-name"><a href="<?php echo get_author_posts_url("$users->ID");?>"><?php echo $users->display_name;?></a></span>
                                <span class="comite-description"><?php echo $users->institution_rattachementUser;?></span>
                                <span class="comite-description"><?php echo $users->fonctionUser;?></span>
                                <span class="comite-description"><?php echo $users->responsableUser;?></span>
                            </div>
                            <div class="button-member">                             
                                <a href="<?php echo get_author_posts_url("$users->ID");?>">En savoir plus</a>
                            </div>
                        </div>
                     <hr class="separator-member">
                 <?php endforeach; ?>
            <?php wp_pagenavi( array( 'query' => $contributor_member ) ); ?>
0
Dim 3 months 0 Answers 12 views 0

Leave an answer