I am trying to create a pagination with just next and previous links instead of 1,2,3..etc.
So I have say item 1,2,3,4,5 in the database and each item is on one page.
If I am on item 2 page I would like a previous link for item 1 page and a next link for item 3 page...etc
So far I got up to retrieving all the items in the database and created a loop to spit out all the URL in each item. But I don't quite know the best way to strip off all the items except the adjacent items. This is the loop I have so far.
foreach ($item_url as $url) : echo $url['url']; endforeach;
This spits out all URL...But how do i proceed to list only the adjacent items and not count the current item I am on...I tried using next($url); to move the pointer if it matches the current item but it didn't work...
Thanks, guys!