I’m trying to do the same thing here and I wasn’t having any luck.
I tried stripping this down to the essentials, and I discovered that when I simply echo get_adjacent_id_smart(true) or get_adjacent_id_smart(false), I get -1. See example:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<p><?php previous_post_smart();?> | <?php next_post_smart();?></p>
<?php $prev_post_id = get_adjacent_id_smart( true ); echo $prev_post_id; endwhile; ?>
Using the default previous/next_post_smart links works just fine.
I’m using this on a custom post type.
Any help is greatly appreciated!