Paginate Links in Wp Query Shortcode

Your $args variable would be helpful. As I can see, you are creating custom WP_QUERY, so get_query_var(‘paged’) isn’t related to your $the_query = new WP_QUERY, but to global $wp_query. Possible solution: declare global $paged and add it to $args = array( /* your args here*/, ‘paged’ => $paged );, also change your get_query_var(‘paged’) to $paged

I want to create pagination for my custom post type archive that i am displaying with loop

You Can try this way: add the following before $args if( get_query_var( ‘paged’ ) ): $my_page = get_query_var( ‘paged’ ); else: if( get_query_var( ‘page’ ) ): $my_page = get_query_var( ‘page’ ); else: $my_page = 1; endif; $paged = $my_page; Replace pagination code with this(make sure to add this after endwhile): $total = $projects->found_posts; $page = … Read more