[Plugin: Smarter Navigation] Using next_post_smart() for complex next/previous links
-
Sometimes, a simple textual link to the next/previous links doesn’t cut it. I, for example, bring back the post IDs of the next/previous posts and construct nice links using the post thumbnail.
You can do this with Smart Navigation using a, for reasons unknown, undocumented method called get_adjacent_id_smart(). Here is an example from my single.php:
$tmn_next_post = get_post(get_adjacent_id_smart( false )); $tmn_previous_post = get_post(get_adjacent_id_smart( true ));
You can see a working example of this on The Modern Nomad.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Plugin: Smarter Navigation] Using next_post_smart() for complex next/previous links’ is closed to new replies.