help with a piece of 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: https://www.layabozi.com
Thank you!
- The topic ‘help with a piece of code’ is closed to new replies.