Show all thumbnails Post from a category
-
Hello,
I would like to show all thumbnails images from a category (ID or name).
For now the theme I’m using has a template page to show all thumbnails from all categories :
<ul class="portfolio"> <?php $i=1; if ( have_posts() ) while ( have_posts() ) : the_post(); if(($i%2) == 0){ $addclass = "nomargin"; } ?> <?php $custom = get_post_custom($post->ID); $lightbox = $custom["lightbox-url"][0]; ?> <li class="<?php echo $addclass; ?>"> <?php $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url( $thumb,'full'); //get img URL $image = aq_resize( $img_url, 420, 247, true ); //resize & crop img ?> <?php if($lightbox!=""){ ?> <span class="image-border"><a class="image-wrap" href="<?php echo $lightbox;?>" data-gal="prettyPhoto[gallery]" title="<?php the_title();?>"><img src="<?php echo $image ?>" alt="<?php the_title(); ?>" /><span class="zoom-icon"></span></a></span> <?php }else{ ?> <span class="image-border"><a class="image-wrap" href="<?php the_permalink() ?>" title="<?php _e('Permanent Link to', 'theme1603');?> <?php the_title_attribute(); ?>" ><img src="<?php echo $image ?>" alt="<?php the_title(); ?>" /></a></span> <?php } ?> <div class="folio-desc"> <h4><a href="<?php the_permalink(); ?>"><?php $title = the_title('','',FALSE); echo substr($title, 0, 40); ?></a></h4> </div> </li> <?php $i++; $addclass = ""; endwhile; ?> </ul>
I would like to be able to add a category “ID”, to show only thumbnails from the category.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Show all thumbnails Post from a category’ is closed to new replies.