Title: A PHP-issue
Last modified: August 19, 2016

---

# A PHP-issue

 *  Resolved [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/a-php-issue/)
 * Hi. I am using the following code to get and display thumbnails from a custom
   field valued “the_field”. It works fine, but when I have too many of these thumbnails
   it breaks my design. How do I limit the output from the code below to a certain
   amount and force the following output on a new line?
 *     ```
       <?php $the_field=get_post_meta($post->ID,"the_output",false); ?>
   
       <?php foreach($the_field as $the_output)
       {
       list($width, $height, $type, $attr) = getimagesize($the_output);
       ?>
       <img src="<?php echo $the_output;?>" <?php echo $attr; ?> alt="">
       <?
   
       }?>
       ```
   
 * Any help would be higly appreciated!

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/a-php-issue/#post-1189964)
 * Try adding a class to the image markup then use CSS to float the images left (
   or right). That way, they’ll wrap within the content area automatically.
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/a-php-issue/#post-1189970)
 * esmi: Thank you! Of course…that is the obvious solution…
 * ..feeling a bit stupid now…
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/a-php-issue/#post-1189975)
 * I have whole days like that…

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

The topic ‘A PHP-issue’ is closed to new replies.

## Tags

 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [limit](https://wordpress.org/support/topic-tag/limit/)

 * 3 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/a-php-issue/#post-1189975)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
