I don’t know whether the code is not working or i am doing something wrong. I have done all the steps but still might be i am not doing anything right. I have found this code on https://www.wpblog.com/use-wp_query-to-create-pagination/ and i have followed all the steps but still having problem.
<?php
get_header(); ?>
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
'posts_per_page' => 4,
'paged' => $paged
);
$custom_query = new WP_Query( $args );
?>
<!----start-------->
have_posts()) :
$custom_query->the_post();
?>
-
" >
">
</ul>
<ul>
<p><?php echo the_content(); ?></p>
</ul>
</div>
<!-- end blog posts -->
<?php endwhile; ?>
<?php if (function_exists("pagination")) {
pagination($custom_query->max_num_pages);
} ?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .wrap -->
<!----end-------->
<?php get_footer();