Title: help with a code
Last modified: August 19, 2016

---

# help with a code

 *  [layabozi](https://wordpress.org/support/users/layabozi/)
 * (@layabozi)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/help-with-a-code/)
 * I just moved to a new server, before i was usin wp2.5.1 and now i moved to 2.6.5.
   
   On my homepage i have a box design and one of the boxes is to show the last entries
   on a category. I worked the code after i found this solution to workout the length
   of the excerpts. the problem is now, the code is not working, and I wonder if
   it is problem because of the wordpress version or something, hopefully, easier
   to solve. Hoping someone will help me descipher a solution. Here the code
 * <div class=”tres”>
    <h3>Reviews</h3> <?php query_posts(‘showposts=3&cat=118’);?
   > <?php while (have_posts()) : the_post(); ?> <?php $values = get_post_custom_values(“
   img-thumbnail”);if (isset($values[0])) {?> ” rel=”bookmark” title=”Permanent 
   Link to <?php the_title(); ?>”><img class=”left” src=”<?php bloginfo(‘url’); 
   echo ‘/’; echo get_option(‘upload_path’); echo ‘/’; $values = get_post_custom_values(“
   img-thumbnail”); echo $values[0]; ?>” alt=”image” width=”100″ height=”100″ style
   =”float:left; margin-right:10px”/> <?php } ?> <h1> <?php the_title(); ?></h1>
   <?php $rem_len = “”; $title_len = strlen($post->post_title); if($title_len <=
   40){ $rem_len=326; }elseif($title_len <= 80){ $rem_len=237; }elseif($title_len
   <= 120){ $rem_len=148; }elseif($title_len <= 160){ $rem_len=59; } $trunc_ex =
   substr($post->post_excerpt, 0, $rem_len); if(strlen($trunc_ex) < strlen($post-
   >post_excerpt)) $trunc_ex = $trunc_ex . ” […]”; echo “<p>” . $trunc_ex . “</p
   >”; ?>
 *  <?php endwhile; ?> <br class=”clear” />
    </div>
 * The website: [http://www.layabozi.com](http://www.layabozi.com)
 * Thank you!

The topic ‘help with a code’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [layabozi](https://wordpress.org/support/users/layabozi/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/help-with-a-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
