Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • ok i’ve got it working on my site

    <?php $my_query = new WP_Query('showposts=7');
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <?php
    if (strlen(the_title('','',FALSE)) > 40) {
      $title_short = substr(the_title('','',FALSE), 0, 40);
      preg_match('/^(.*)\s/s', $title_short, $matches);
      if ($matches[1]) $title_short = $matches[1];
      $title_short = $title_short.' ...';
      }
    else
      {
      $title_short = the_title('','',FALSE);
      }
    ?>
    
    <a title="<?php echo the_title() ?>" href="<?php the_permalink() ?>"><?php echo $title_short ?></a><br>
    
    <?php endwhile; ?>

    i’ve got the same problem. anybody an idea?

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