Can anyone help me fixing this code as I am having problem creating pagination using WP_query


I have use that code but still i am having some issues as it is not working properly or might be i am doing something wrong. Can anyone guide me on this as i have found this code on . I have put all my efforts but still having issues.

get_header(); ?>
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
  'posts_per_page' => 4,
  'paged' => $paged
$custom_query = new WP_Query( $args );
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
   while($custom_query->have_posts()) :
           <h3><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h3>
        <div><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a></div>
        <p><?php echo the_content(); ?></p>
          </div> <!-- end blog posts -->
       <?php endwhile; ?>
      <?php if (function_exists("pagination")) {
      } ?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .wrap -->
<?php get_footer();


I don’t see how it relates to Couchbase PHP SDK. What issues do you have?