How Do I make Pagination work on Front Page?

Viewed 29

I added pagination with paginate_links( $args_pagi), but the result pages do not have the paginated content, instead they have the same content.

global $wp_query;
$args_pagi = array(
    'base' => add_query_arg( 'paged', '%#%' ),
    'total' => $posts->max_num_pages,
    'current' => $paged
    );
                $html .= '<div class="post-nav">';
                    $html .= paginate_links( $args_pagi);

                //    $output .= '<div class="next-page">' . get_next_posts_link( "Older Entries »", 3 ) . '</div>';

                $html .= '</div>';

            else:

                $html .= '<p>Sorry, there are no posts to display</p>';

            endif;

This is the code I added to get pagination. This is done on front page, Do I need to add anything extra to my theme page, etc? to functions.php??

0 Answers
Related