How can I get next post id after current post id for custom post type
If you are using the code inside a custom post type template, then the get_next_post() will get the next post for you. Then you can use the ->ID and get it’s ID. So: $next_post = get_next_post(); $next_post_id = $next_post->ID; If you need their link, simply use next_post_link() or previous_post_link(). These functions use the global post … Read more