get next post custom post type

Solutions on MaxInterview for get next post custom post type by the best coders in the world

showing results for - "get next post custom post type"
Jesús
24 Jan 2020
1<?php
2$prev_post = get_previous_post();
3if($prev_post) {
4   $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
5   echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">« Previous post<br /><strong>"'. $prev_title . '"</strong></a>' . "\n";
6}
7
8$next_post = get_next_post();
9if($next_post) {
10   $next_title = strip_tags(str_replace('"', '', $next_post->post_title));
11   echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post »<br /><strong>"'. $next_title . '"</strong></a>' . "\n";
12}
13?>
14