How to link category post thumbs to full size images
-
I have a page the displays 20 post category thumbnails. Currently each thumbnail links to the post page, how would i make the category thumbnail link to the full sized image instead of the post page.
<?php $thumbnails = get_posts('category_name=portfolio-logo&numberposts=20'); foreach ($thumbnails as $thumbnail) { if ( has_post_thumbnail($thumbnail->ID)) { echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">'; echo get_the_post_thumbnail($thumbnail->ID, 'thumbnail'); echo '</a>'; } } ?>
thats what im using now and i tried to figure it out using the link below but i cant figure it out. Still kinda new to this stuff…
https://codex.www.ads-software.com/Function_Reference/the_post_thumbnail
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to link category post thumbs to full size images’ is closed to new replies.