• Resolved etruchan

    (@etruchan)


    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)
  • 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

    (@etruchan)

    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.

    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

    (@etruchan)

    Fixed it thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stumped with php’ is closed to new replies.