• Hi there!

    A pair of years ago I ordered a web designer to build a WordPress Based Web. (Here you have it http://www.peluqueriamartinez.com) The case is that some weeks ago I decided that it was time to update it a little bit, but the person who design my web left me in the lurch and I have to do it all by myself. My level of CSS, html and php is really really poor. I have done all the changes I wanted to, except one thing. Please, I need help with that.

    In my homepage you will find the excerpts of the last two posts. I wanted to display the featured image just below every excerpt. Ok, I did it, but now I want them to have the same width as the paragraphs of every excerpt. That’s where I have the problems. I’ve used plugins such as “Quick Featured Images” and “Regenerate Thumbnails”, but when I shrink my window everything shrinks eccept those thumbnails. How can I make them responsive?

    Here’s the peace of code I use to display my post thumbnails:

    <h2 class="titHomeNoticias">Últimas publicaciones</h2>
    			 <ul id="homeNoticias">
    			 <?php
    			 	$args = array( 'numberposts' => '2' );
    			 	$recent_posts = wp_get_recent_posts( $args );
    			 	foreach( $recent_posts as $recent ){
    			 		echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look 					'.esc_attr(	$recent["post_title"]).'" >' .   $recent["post_title"].'</a>
    			 		<p>'.$recent["post_excerpt"].'</p>'.
    			 		'<figure>'.get_the_post_thumbnail($recent["ID"], "thumb").'</figure>'.
    			 		'</li>';
    
    				}
    			 ?>

    Can anybody help me? I’m learning those things, please, be understanding with me…

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    For those images specifically, you can add this CSS to make the images fit:

    #homeNoticias img { height: auto; max-width: 100%; }

    If you need it on other images, you might be able to just target “img” instead of “#homeNoticias img”, but you’d want to test that out by making sure it doesn’t break other images on the site.

    Thread Starter dmcodina

    (@dmcodina)

    Aggg!! I’m so bad with CSS that I don’t know where to put that peace of code! Could you help me?? I’m trying so hard!

    By the way, thanks a lot mindctrl!

    No problem! The easiest way will be to install Simple Custom CSS and add it in the plugin’s interface. It’s easier, and you won’t lose your customizations when you install updates in the future.

    Thread Starter dmcodina

    (@dmcodina)

    Thanks a lot mindctrl! I’m downloading that Simple Custom CSS plugin right now. Let’s see if I cant solve it!

    Thread Starter dmcodina

    (@dmcodina)

    Agg… I’m again at the same point. It’s just typing that peace of code in Simple Custom CSS and it makes all the work? Doesn’t work for me. Do I have to type it with the “#”? I’m sorry, I don’t know much about CSS… :-S

    Yes you need the #

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

The topic ‘How to make Thumbnail Posts responsive’ is closed to new replies.