• Hello,

    I want to show the other posts on CPT in the Next/Prev section of my custom singular page. not show any taxonomies (Tag, Category, custom Tag, custom Category)
    In this regard, I call the Next/Prev.php file for CPT layout and change in codes in accordance with the following method:
    But not work ??

    // Only display for CPT
    if ( 'cpt' != get_post_type() ) {
    	return;
    }
    
    // Term
    $post_type = get_post_type( 'cpt' );
    $post_type = $post_type ? $post_type : 'cpt';
    
    // Args
    $args = array(
    	'prev_text'             => '<span class="title"><i class="fas fa-long-arrow-alt-left"></i>'. esc_html__( 'Previous Post', 'oceanwp' ) .'</span><span class="post-title">%title</span>',
        'next_text'             => '<span class="title"><i class="fas fa-long-arrow-alt-right"></i>'. esc_html__( 'Next Post', 'oceanwp' ) .'</span><span class="post-title">%title</span>',
        'in_same_term'          => true,
        'taxonomy'              => $post_type,
        'screen_reader_text'    => esc_html__( 'Continue Reading', 'oceanwp' ),
    );

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Edit Next/Prev file according to CPT’ is closed to new replies.