Reputation: 2628
I'm creating a WordPress photoblog theme and I want to create a thumbnails page that sits between index.php and single.php.
The idea is that when someone clicks on a blog post, they go to the thumbnails page to see all photos attached to that post and they then click on an individual image to be redirected to the blog entry. Does WP templating support this?
Upvotes: 0
Views: 287
Reputation: 298146
WordPress just loads the files inside of the theme's directory, so you aren't limited by WP much.
If you want, why not just make the index.php
file have a section which runs only when it receives a $_GET
variable denoting that the user has requested the thumbnails page?
This is sort of what I mean:
single.php:
<?php
if (isset($_GET['gallery']))
{
// Show the gallery.
} else {
// Show the main content instead
}
?>
And on index.php
, you could add the gallery
parameter to the URLs:
<a href="single.php?gallery=1&foo=bar">Title of Article</a>
But that's just the way I'd do it.
Upvotes: 1
Reputation: 28125
I don't see what you mean by "the user clicks on a blog post", but in short, you could modify the main template to write a link like:
<a href="showphotos.php?id=POST_ID">Show Photos</a>
Then write some custom plugin to manage a set of photos per blog post.
Finally, create a page "showphotos" and assign it to a theme file and add the necessary PHP code to generate the thumbnails inside of it.
The problem with your question is that you're asking something similar to "how do I build a wooden tower"? There are different ways, and each depend on different use cases, none of which are specifically tackled by your question. Don't forget that we on SO are not here to create plugins for you, so don't ask for elaborate systems and instead focus on what's bugging you.
Upvotes: 0