'how to add pagination in child posts list

I created a custom post type called Programs, Each program contains episodes Episodes will be Child Post Some programs contain more than a hundred episodes, so I want to add pagination to my child posts list I've had a basic attempt at this using $paged = (get_query_var('page')) ? get_query_var('page') : 1; and the paged argument in the WP_Query, but my next_posts_link doesn't work. my code to show child post

<?php

        $args = array(
            'post_type'      => 'programs',
            'posts_per_page' => 60,
            'post_parent'    => $post->ID,
            'order'          => 'ASC',
        );


        $parent = new WP_Query( $args );

        if ( $parent->have_posts() ) : ?>
        <div class="penci-border-arrow penci-homepage-title penci-magazine-title style-5 pcalign-right pciconp-right pcicon-right" style="border-color: #3E68B0">
        <h3 class="inner-arrow" style="background:#3E68B0;border-color: #3E68B0">
        الحلقات </h3>
        
        </div>
        <ul class="penci-wrapper-data penci-grid">    
            <?php while ( $parent->have_posts() ) : $parent->the_post(); 
            $featured_img_url = get_the_post_thumbnail_url(get_the_ID());
            $episode_number = get_field('episode_number', get_the_ID());
            ?>
            
            <li class="list-post pclist-layout">
            <article id="post-<?php the_ID(); ?>" class="item hentry">
            <div class="thumbnail child-thumbnail"> 
            <a class="penci-image-holder penci-lazy" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" style="background-image: url(<?php echo $featured_img_url?>);">
            </a>
            </div>
            <div class="content-list-right content-list-center child-content">
                <div class="header-list-style">
                <div class="episode-details">
                    <span class=""> <a class="url fn n" href="<?php the_permalink(); ?>"><?php echo  $episode_number ?></a></span> 
                    <span style="margin:0 20px"><a>|</a></span>
                    <span class="featc-date"><time class="entry-date published" datetime="2021-10-31T13:26:29+00:00">2021-10-31</time>
                    </span>
                    <span class='program-viewcn'><?php pvc_stats_update( get_the_ID(), 1 ); ?></span> 
                </div>
                    <h2 class="grid-title entry-title">
                      <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                    </h2>
                </div>
                <div class="item-content entry-content">
                    <p>
                    <?php the_excerpt();?>
                    </p>
                </div>
                
            </div>
            </article>
            </li>
            <?php endwhile; ?>
        </ul>
        <?php endif; ?> 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source