Forums

[resolved] the_post_thumbnail issues (4 posts)

  1. Rhand
    Member
    Posted 1 year ago #

    I am using this code in my child theme to render thumbnail images for an image gallery:

    <!-- Content of the slider Start  -->
    
    		<?php rewind_posts(); $i = 1; while (have_posts()) : the_post(); ?>
    
    			<div id="fragment-<?php echo $i; ?>" class="ui-tabs-panel" style="">
    
    			<?php if((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?>
    
    			<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail( array(600,450));  ?></a>
    
    			<?php endif; // endif post thumbnail ?>
    
    				<div class="info" >
    
    					<h2><a href="#" ><?php the_title(); ?></a></h2>
    					<div id="slide-excerpt"><?php the_excerpt(); ?></div>
    					<div id="slide-readmore"><a href="<?php the_permalink(); ?>" ><img src="<?php echo CHILDTEMPLATEIMAGES.'/main-slide-readmore.png'; ?>" alt="readmore" >  </img></a></div>
    
    				</div> 
    
    			</div> 
    
    		 <?php $i++; endwhile; ?> 
    
    		  <!-- Content of the slider end  -->

    Somehow the images are rendered as 500 by 337 pixels and because of that I have an ugly empty space of 100 pixels. What am I missing here? Why are they not resized properly? The original images are bout 700 pixels by 450 pixels so they should do..

  2. Rhand
    Member
    Posted 1 year ago #

  3. Rhand
    Member
    Posted 1 year ago #

    Still no idea. Anyone knows how I can enforce resizing? I did upload the images anew but they still are 500 by 375, which is really odd..

  4. Rhand
    Member
    Posted 1 year ago #

    Never mind. Had to add my custom thumbnail for that gallery and now all seems to be peachy. I added the following to my child theme's functions.php :

    if (function_exists('add_theme_support')) { // thumbnail for homepage gallery
    	add_theme_support('post-thumbnails');
    	add_image_size('tabbed-slider-thumb', 600, 450, true);
    }

Topic Closed

This topic has been closed to new replies.

About this Topic