linking thumbnail from one gallery to another using categories
-
So I am new to wordpress. I’m trying to set up a series of galleries using categorized posts and their thumbnails.
I have a “gallery page” that displays a thumbnail image from a featured image of a certain artist. The category I’m using is ‘Artwork’. This thumbnail should link to a second gallery of that artists work. This second gallery uses the category ‘artist_name’ (example Pablo_Picasso)
I’ve set up two custom template pages: page-main-gallery.php and page-artist.php
my page-main-gallery code is this:
<div class="row"> <?php query_posts('category_name=artwork'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="col-sm-4 thin-border"> <h3><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></h3> <p><em><?php the_time('l, F jS, Y'); ?></em></p> </div> <?php endwhile; else: ?> <p><?php _e('Sorry, there are no posts.'); ?></p> <?php endif; ?> </div><!-- end row -->
This works great in displaying a gallery of the images labeled ‘artwork’. BUT I’m trying to figure out how to link each thumbnail to a second page displaying the artwork of that displayed artist.
I’ve made a second template page called page-artist-php which is basically the same markup, but instead of
<?php query_posts('category_name=artwork'); ?>
I use:
<?php query_posts('category_name=artist_name'); ?>
so how do I adjust the code in page-main-gallery.php that references the link:
<h3><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></h3>
- The topic ‘linking thumbnail from one gallery to another using categories’ is closed to new replies.