- This topic has 21 replies, 3 voices, and was last updated 5 years, 1 month ago by
David.
-
AuthorPosts
-
September 2, 2019 at 3:29 am #998976
David
StaffCustomer SupportSo if you go to Blog > Customizer > Layout under Content select the Single tab and uncheck: Display post navigation … this doesn’t work?
https://docs.generatepress.com/article/blog-content-layout/#single
September 2, 2019 at 3:40 am #998982Matt
No, I just deleted CSS: .nav-links { display: none; }
then tried your way, and the Next/previous are back again!
September 2, 2019 at 4:03 am #998993David
StaffCustomer SupportIf you want to start a new topic where you can share your site privately using the Site URL i can take a look as to why unchecking Display post navigation isn’t working.
July 13, 2020 at 4:02 am #1361740jasond
I had 2 filters to customize the prev/next texts on Post, how to add another filter for CPT?
Many thanks
add_filter( 'next_post_link', function( $output, $format, $link, $post ) { if ( ! $post ) { return ''; } return sprintf( '<div class="nav-next"><span class="next"><a href="%1$s" title="%2$s">Next Article</a></span></div>', get_permalink( $post ), $post->post_title ); }, 10, 4 ); add_filter( 'previous_post_link', function( $output, $format, $link, $post ) { if ( ! $post ) { return ''; } return sprintf( '<div class="nav-previous"><span class="prev"><a href="%1$s" title="%2$s">Previous Article</a></span></div>', get_permalink( $post ), $post->post_title ); }, 10, 4 );July 13, 2020 at 7:01 am #1361884David
StaffCustomer SupportHi there,
you can introduce more if condtions – for example:
add_filter( 'next_post_link', function( $output, $format, $link, $post ) { if ( ! $post ) { return ''; } elseif ( is_singular( 'book' ) { // return your CPT nav link content here } // return standard post return sprintf( '<div class="nav-next"><span class="next"><a href="%1$s" title="%2$s">Next Article</a></span></div>', get_permalink( $post ), $post->post_title ); }, 10, 4 );September 25, 2020 at 3:11 pm #1459216onalti
I tried it for custom post typle but it doesn’t work.
add_filter( 'next_post_link', function( $output, $format, $link, $post ) { if ( ! $post ) { return ''; } elseif ( is_singular( 'book' ) { // return your CPT nav link content here } // return standard post return sprintf( '<div class="nav-next"><span class="next"><a href="%1$s" title="%2$s">Next Article</a></span></div>', get_permalink( $post ), $post->post_title ); }, 10, 4 );September 26, 2020 at 2:24 am #1459584David
StaffCustomer SupportHi Onalti,
could you raise a new topic explaining what you require as this topic is a mass of various requests.
-
AuthorPosts
- You must be logged in to reply to this topic.