Site icon Hip-Hop Website Design and Development

order by post_date doesn’t work in Earlier and Subsequent put up

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

operate 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' );

operate wpsites_image_nav_links() {
    if (is_singular('put up')) {
        $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; prime: -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; prime: -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  }
}