Custom loop in single post template
-
Hi there
I have a problem that I can’t seem to solve on my own:
I’m doing this portfolio for a photographer friend, and we’re uploading each picture as a new blog entry, attaching it using the “featured image”-feature.
That’s not the problem, works fine.The thing is I want to be able to cycle through all the pictures, jcarousel-wise, in each category. Right now when viewing a single picture, I load it through the single-post-template-file, and then using next_post_link() and previous_post_link(), you can go to the next or previous picture. That also work fine.
But I figure, if I want to able to loop through the pictures with jcarousel, I need to write some changes to the loop in the single-post-template.
I need to load:
1. the current post (like now; post no. 5 for instance in a category)
2. all the next posts in the category (no. 5 to 10 for instance)
3. all the posts before the current post (no. 1 to 4 for instance)I don’t suspect this to be too complicated, I just can’t seem to wrap my head around it on my own.
Thank you very much to everyone with ideas to throw in.//A.
- The topic ‘Custom loop in single post template’ is closed to new replies.