Edit portfolio image link to the portfolio's content
-
Hi there! I’m setting up a portfolio page on my website. The page populates itself with the featured image of each portfolio item. By default, these images are wrapped in an anchor tag linked to an individual page for the portfolio item.
My goal is to change the link to point at the content of the portfolio, which will have a YouTube link in it. That way when a user clicks the portfolio image a lightbox will open with the YouTube video. Here is a snippet of the current code from the theme I’m using, plus the rel attribute calling the lightbox “prettyPhoto” I added.
<?php $src = get_post_thumb($post->ID,640,0); $srcSmall = get_post_thumb($post->ID,350,250); $term_list = wp_get_post_terms($post->ID, 'portfolio-cat'); $c=1; ?> <div class="four columns<?php foreach ($term_list as $term) { echo " ".$term->slug; } ?>"> <div class="hover-image"> <a href="<?php echo $src['src'];?>" rel="prettyPhoto"> <img src="<?php echo $srcSmall['src'];?>" alt="<?php the_title();?>"></a> </div> <h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4> </div>
You can see what this looks like here: https://2minaudition.com/past-auditions/
So, basically, what do I need to change the HREF to so that it loads the content of the portfolio (a YouTube URL)?
- The topic ‘Edit portfolio image link to the portfolio's content’ is closed to new replies.