Site icon Hip-Hop Website Design and Development

Order by post_date doesn’t work in Earlier and Subsequent publish pagination

I’ve added a earlier and subsequent pagination with thumbnail for my single publish template but it surely doesn’t exhibiting the proper earlier and subsequent publish. Additionally, noticed its exhibiting the earlier and subsequent publish order by publish ID and tried to alter the order by post_date but it surely doesn’t work. Beneath are the code of publish navigation. Can somebody assist me please…

perform wpse73190_adjacent_post_sort( $orderby ){
    return "ORDER BY p.post_date DESC LIMIT 1";
}
add_filter( 'get_previous_post_sort', 'wpse73190_adjacent_post_sort' );
add_filter( 'get_next_post_sort', 'wpse73190_adjacent_post_sort' );

perform wpsites_image_nav_links() {
    if (is_singular('publish')) {
        $excluded_terms = '39';
        echo '<div class="nav_container">';
        $prev_post = get_previous_post($excluded_terms);
        $next_post = get_next_post($excluded_terms);
        if (!empty( $prev_post )): ?>
            <?php $prevthumb = get_the_post_thumbnail_url( $prev_post->ID, 'full' ); ?>
            <?php echo'<span type="background:url('.$prevthumb.')" class="single-post-nav previous-post-link">'; ?>
            <a href="<?php echo $prev_post->guid ?>">
            <?php echo "<div id='borderLeft'></div><div class='form' type='left:0; z-index:1; place: absolute; high: -15px;'>
            <div id='curved-corner-bottomleft'></div>
            <div id='curved-corner-topleft'></div>
            </div>"; ?>   
            <?php echo "<p>".$prev_post->post_title."</p>"; ?>
            </a>
            <?php echo'</span>'; ?>
        <?php endif; ?>
        
        <?php if (!empty( $next_post )): ?>
            <?php $nextthumb = get_the_post_thumbnail_url( $next_post->ID, 'full' ); ?>
            <?php echo'<span type="background:url('.$nextthumb.')" class="single-post-nav next-post-link">'; ?>
            <a href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>">
            <?php echo "<div id='borderRight'></div><div class='form' type='proper:0; z-index:1; place: absolute; high: -15px;'>
            <div id='curved-corner-bottomright'></div>
            <div id='curved-corner-topright'></div>
            </div>"; ?>
            <?php echo "<p>".esc_attr( $next_post->post_title )."</p>"; ?>
            </a>
            <?php echo '</span>'; ?>
        <?php endif; ?>
        <?php echo '</div>'; ?>
    <?php  }
}