• Lordwarz

    (@lordwarz)


    Hello,

    I’m trying to resize the featured image that show on my index page but i can’t seem to be able to modify the height of the image.

    <!-- Begin post -->
    			<div id="post-<?php the_ID(); ?>" <?php post_class('posthome'); ?>>
    				<?php if ( has_post_thumbnail() ) { ?>
    							<div class="">
    								<a href="<?php the_permalink(); ?>">
    									<?php
    										$image_src = wp_get_attachment_image_src( get_post_thumbnail_id(),'post-thumbnail' );
                                            $title = get_the_title();
    	     								echo '<img src="' . $image_src[0]  . '" width="100%" alt="'.$title.'" />';
                                        ?>
    					        	</a>
    					    	</div><!-- End Thumb Container -->

    this part of the above code lets me resize the image, but how do i add a fragment of code to adjust the height?

    '<img src="' . $image_src[0]  . '" width="100%" alt="'.$title.'" />';

    I tried Settings > Media > thumbnails but it doesn’t seem to work so i have resorted to modifying the code.

    This part of the code comes from the page index.php

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature Image Size’ is closed to new replies.