WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

im having a problem figuring this out. I am displaying a random post on the header of my site but the post-thumbnail looses quality when I add a custom size. How can i make it not loose quality?

This is the code in header.php

$args = array( 'numberposts' => 1, 'orderby' => 'rand', 'post_status' => 'publish', 'offset' => 1);
 $rand_posts = get_posts( $args );
 foreach( $rand_posts as $post ) : ?>
 <div class="post-thumb-title"><?php the_post_thumbnail(array(730,250)); ?>
 <p class="thumb-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ? >"><?php the_title(); ?></a>
 <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
 <?php endforeach; ?></div>

And this is the css

div.post-thumb-title {
width: 730px;
margin: 1em auto;

div.post-thumb-title img {
display: block;
min-width: 100%;

div.post-thumb-title p.thumb-title {
margin: 0;
height: 2em;
line-height: 2;
position: relative;
top: -2em;
max-width: 100%;
text-align: center;
 color: #fff;
background: rgba(0, 0, 0, 0.7);

Image quality is horrible. Am i doing something wrong or is there a fix for this? Thanks for your help

share|improve this question
What do you have in your Settings Media Screen? And do you have thumbnail customizations in your functions.php? – Max Yudin Sep 26 '12 at 8:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.