• I’ve been scouring the web looking for a solution to this, maybe someone can help.

    We have a photo site that’s got hundreds of images. It works in a custom way: The category is selected and thumbnails show (using category.php template). You click a thumbnail to see the ‘post’ in ‘single.php’ which includes a photo, description, etc. along with “Next / Previous” links.

    The problem is, we have the posts in multiple categories which are children of two main categories. WordPress always defaults to the parent category when you click the thumbnail and load ‘single.php’, so the “Next /Previous” links always go to the main categories… we can’t navigate in the child categories. In other words, by clicking to the single.php, we ‘lose’ the information about what category the user has been exploring.

    I’ve thought of passing the category from the category.php template to the single.php in a var (like the session or cookie), but maybe it’s in some WordPress array already? Passing the current category in the var is actually not straightforward: I haven’t figured it out yet… and then I’d have to make it work in the Next/Previous navigation, after that. I’ve been playing with “Ambrosite Next/Previous Post Link Plus” hoping there was a solution there, but no luck.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can you provide the url of your site?

    Thread Starter richoid

    (@richoid)

    I think the problem is that you are linking to single.php, where if you would link a image to the image-atachment template or image.php you stay in the same category when clicking prev and next.

    Thread Starter richoid

    (@richoid)

    Heh… that was the best solution for this site architecture. The href=the_permalink, basically. Maybe I could append to that url to carry the category forward to the next page, but it would uglify the url. Then I’d have to figure out how to mix in the category with the previous/next links once I’m in single.php. I’d rather stick it somewhere hidden… maybe this is a job for jQuery.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Making "Next/Prev" buttons stay within child category’ is closed to new replies.