Title: Stumped with php
Last modified: August 21, 2016

---

# Stumped with php

 *  Resolved [etruchan](https://wordpress.org/support/users/etruchan/)
 * (@etruchan)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/stumped-with-php/)
 * I am simply trying to resize an image derived from the featured image. How do
   I scale the image down by exact w x l or %? Here is the cade:
 *     ```
       <?php
       				if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
       				echo '<img src="'. the_post_thumbnail() .'" />';
       				}
       			?>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [coder314159](https://wordpress.org/support/users/coder314159/)
 * (@coder314159)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/stumped-with-php/#post-4145544)
 * I’d try in the style.css file first not the php. Remember when working with a
   theme make sure to make your customization on a child theme.
 *  Thread Starter [etruchan](https://wordpress.org/support/users/etruchan/)
 * (@etruchan)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/stumped-with-php/#post-4145664)
 * I understand what you are saying but I do not know how to accomplish what you
   speak of. Also, I have got to assume that there is an easier way with inline 
   code.
 * The above code is derived prom a working template as shown below:
 *     ```
       <?php
       /*
       Template Name Posts: New Works
       */
       ?>
       <?php get_header(); ?>
           <br>
           <div class="art-content-layout">
           <div class="art-content-layout-row">
           <div class="art-layout-cell" style="width: 55%" >
       			<?php
       				if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
       				echo '<img src="'. the_post_thumbnail() .'" />';
       				}
       			?>
           </div>
           <div class="art-layout-cell" style="width: 45%" >
              <p><h2> Job Name: <?php the_field('job_name'); ?></h2></p>
              <p><h2> Job Location: <?php the_field('job_location'); ?></h2></p>
              <p><h2> Job Type: <?php the_field('job_type'); ?></h2></p>
           </div>
           </div>
       </div>
        <?php get_footer(); ?>
       ```
   
 * It just needs to be stylized differently via a smaller image.
 *  [coder314159](https://wordpress.org/support/users/coder314159/)
 * (@coder314159)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/stumped-with-php/#post-4145682)
 * I understand the mistake, it is common unless you’ve had enough web design/development
   experience but should not be doing inline styling on your site it’s bad practice.
   If you look into your theme folder, you’ll find the style.css file to update.
   There are tons of tutorials and videos easily search on google to show you how
   to style your site that you can easily learn.
 *  Thread Starter [etruchan](https://wordpress.org/support/users/etruchan/)
 * (@etruchan)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/stumped-with-php/#post-4145844)
 * Fixed it thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Stumped with php’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [etruchan](https://wordpress.org/support/users/etruchan/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/stumped-with-php/#post-4145844)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
