• I’m looking to create a dynamic sidebar navigation, which always displays the previous n links, current link (which is the active post page), and the next n links. The previous and next links are relative to the current link, so for example if you are on the latest page, there would be no next links, and only previous links.

    I’ve tried a few iterations of wp_query and such. get_posts() almost does it, though it doesn’t work with “negative” posts (if it did, this should solve it, but I haven’t found a way yet).

    Anyone have any ideas how this might work? I’m now thinking of doing a SQL query to get the current record and then retrieve the next n (say 4) records, and do the same for previous records.

    Any ideas or tips?

    Thanks!

  • The topic ‘Dynamic Navigation (Post Links) Based on Current Post’ is closed to new replies.