Title: multibyte custom excerpt code
Last modified: August 19, 2016

---

# multibyte custom excerpt code

 *  [thewpfan](https://wordpress.org/support/users/thewpfan/)
 * (@thewpfan)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/multibyte-custom-excerpt-code/)
 * I found this code on-line as I am trying to return 140 characters for multibyte
   Japanese characters on a custom front page, but I am doing something wrong as
   it is not returning anything. I am not sure if is because strip_tags is not a
   defined function. Can someone please tell me what I need to get this to work?
   Thank you.
 * front.php –
 *     ```
       <?php
           $recentPosts = new WP_Query();
           $recentPosts->query('showposts=5');
       ?>
       <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
   
       <li><a>" rel="bookmark"><?php echo winexcerpt(140); ?></a></li>
       <?php endwhile; ?>
       ```
   
 * functions.php –
 *     ```
       function winexcerpt( $length ) {
          global $post;
          $content = mb_substr(strip_tags($post->post_content),0,$length);
          return $content;
       }
       ```
   

The topic ‘multibyte custom excerpt code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [thewpfan](https://wordpress.org/support/users/thewpfan/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/multibyte-custom-excerpt-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
