Add pagination to custom single post template

Hope, the below code is helpful for you to write a custom pagination link.

$post_id = $post->ID; // current post ID

$args = array( 
    'post_type' => 'stories',
    'orderby'  => 'post_date',
    'order'    => 'DESC'
);
$posts = get_posts( $args );

// get IDs of posts retrieved from get_posts

$ids = array();

if(isset($posts) && !empty($posts)) {
    
    foreach ( $posts as $thepost ) {
        $ids[] = $thepost->ID;
    }

    // get and echo previous and next post in the same category

    $thisindex = array_search( $post_id, $ids );

    $previd    = isset( $ids[ $thisindex - 1 ] ) ? $ids[ $thisindex - 1 ] : false;
    $nextid    = isset( $ids[ $thisindex + 1 ] ) ? $ids[ $thisindex + 1 ] : false;

    if (false !== $previd ) {
        ?><a rel="prev" href="<?php echo get_the_permalink($previd) ?>">Previous</a><?php
    }
    if (false !== $nextid ) {
        ?><a rel="next" href="<?php echo get_the_permalink($nextid) ?>">Next</a><?php
    }
}