• how can i parmalink to thumbnails ?

    <?php
    global $query_string;
    query_posts($query_string . '&post_type=trailer&posts_per_page=4&meta_compare=EXISTS' );
    if( have_posts() ) :
    
    	$i = 0;
    
    	while( have_posts() ) : the_post();
    
    		$i++; // count
    
    		if( !$paged && $i == 1) {
    			the_post_thumbnail( 'trailerbig' );
    		}
    		else {
    
    			the_post_thumbnail( 'trailerlit' ); 
    
    		}
    
    	endwhile;
    
    endif;
    
    ?>

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there sasanam!

    Are you asking about creating a link using the post thumbnail?

    One way I can think of would be using the_permalink() or even get_permalink() along with get_the_post_thumbnail().

    You could create something like:

    printf( '<a href="%s">%s</a>', get_permalink(), get_the_post_thumbnail( get_post(), 'trailerlit' ) );

    That’s just off the top of my head thinking. Unless you mean something else, if so would you mind explaining a little more on what you mean?

    Thread Starter sasanam

    (@sasanam)

    thanks man !!!

    it works <3

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Awesome!

    Glad it worked. Don’t forget to mark it as resolved. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get thumbnail link on this loop’ is closed to new replies.