Display more than 10 posts on author.php file

when you use the loop the number of post displayed is choosen fron the option set in Settings->Reading in you backend. It affects all the standard loops, not only the author page. To change only for author page you have to use pre_get_posts hook and set the wanted number of posts using posts_per_page argument: add_action(‘pre_get_posts’,’change_numberposts_for_author’); … Read more

How to get the number of pages when paginating comments?

Try get_comment_pages_count()? <?php get_comment_pages_count( $comments, $per_page, $threaded); ?> I’m guessing you’re outside the loop, since you’re calling get_comments(); in that case, you’ll need to pass your $comments object: $comments = get_comments(array( ‘post_id’ => $post_id, ‘status’ => ‘approve’ )); wp_list_comments(array( ‘page’ => 1, ‘per_page’ => 10, ‘avatar_size’ => 16, ), $comments); $comment_page_count = get_comment_pages_count( $comments );

How to add PHP pagination to wordpress

you can use paginate_links() from wordpress core API, its make more easily to paginate your custom query. And you dont need to make another query to get all users count. <?php $users_per_page = 10; // total no of author to display $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; if( (int)$paged === 1 ){ $offset = … Read more

Unable to paginate a custom page query

The problem was in the same name for category slug “categories” and the same for the custom page that was holding all categories with the same name “categories”. I have solved that by changing categories slug (in permalinks settings) to singular “category” and I have left custom page as plural “categories”. If somebody know about … Read more

Remove Post if Advanced Custom Field is checked to fix paging

Use WP_Query instead, and you can use the meta_key / meta_value parameters: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘cat’ => 10, ‘paged’ => $paged, ‘posts_per_page’ => 12, ‘post_status’ => ‘any’, ‘order’ => ‘ASC’, ‘meta_key’ => ‘archived’, ‘meta_value’ => ‘true’ ); $posts = new WP_Query($args); ?> <?php while($posts->have_posts()): $posts->the_post(); ?> <?php … Read more

error code: 521