• Resolved Lindsey

    (@lalindsey)


    Hello!

    I’m currently working on a single page site where we are going to have a “News” section that is horizontally scrollable. What I have now is the main page, which displays a listing of the 3 most recent posts. Clicking on the link moves the page to the left and the posts chosen replaces the listing of posts.

    What I want to do is add next and previous links to this.

    I can’t use next_post() since it’s the single page permalink – and in this case we have all of our content on one page.

    So what I want to do is control the next and prevous links and have them link to the post using the post id like so: <a href="#post-34"> instead of <a href="mysite.com/post-34">

    Also, it will need to work within a custom query – you can view the code controlling the sections here:

    https://pastebin.com/Y35ie59k

Viewing 1 replies (of 1 total)
  • Thread Starter Lindsey

    (@lalindsey)

    Hello all I have I found a solution with the help of a fellow forrst member.

    You can view the code here:

    https://pastebin.com/4AY7dFcN

    Also, I’ve implemented code to change the link on the previous link on the first post, and hide the next link on the last post.

    Hope this can help someone else in the future!

    -Lindsey

Viewing 1 replies (of 1 total)
  • The topic ‘Changing next and previous post links’ is closed to new replies.