Title: doffer's Replies | WordPress.org

---

# doffer

  [  ](https://wordpress.org/support/users/doffer/)

 *   [Profile](https://wordpress.org/support/users/doffer/)
 *   [Topics Started](https://wordpress.org/support/users/doffer/topics/)
 *   [Replies Created](https://wordpress.org/support/users/doffer/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/doffer/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/doffer/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/doffer/engagements/)
 *   [Favorites](https://wordpress.org/support/users/doffer/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [How to exclude smileys from image count…](https://wordpress.org/support/topic/how-to-exclude-smileys-from-image-count/)
 *  Thread Starter [doffer](https://wordpress.org/support/users/doffer/)
 * (@doffer)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/how-to-exclude-smileys-from-image-count/#post-220383)
 * Guess I misunderstood you, because something got wrong… I’m getting this error:
   Parse error: parse error, unexpected T_STRING in /usr/home/web/wno14743/blog/
   wp-content/plugins/teb-word-count.php on line 27
 * `<?php
    /* Plugin Name: Word Count Plugin URI: http://www.jonas.rabbe.com/archives/
   2005/05/06/word-count-plugin-for-wordpress/ Description: This plugin counts the
   number of words and images per post. Version: 1.0 Author: Jonas Rabbe Author 
   URI: http://www.jonas.rabbe.com/ */
 * // This just echoes the chosen line, we'll position it later
    function teb_word_count(
   $display = true) { global $wpdb, $id; $post = $wpdb->get_var("SELECT post_content
   FROM $wpdb->posts WHERE ID = $id");
 *  $post_content = apply_filters('the_content', $post);
    $words = trim(strip_tags(
   $post_content)); if( $words == '' ) { $wordcount = 0; } else { $words = explode('',
   $words); $wordcount = count($words); } $ret_words = number_format($wordcount).''.(
   $wordcount == 1 ? 'ord' : 'ord');
 *  $imagecount = preg_match_all('/<img/', $post_content, $images);
    $imagecount-
   =preg_match_all('/<img[^>]+(?=(class='wp-smiley'))/s', $post_content, $images);
   $ret_images = number_format($imagecount) . ' ' . ($imagecount == 1 ? 'bilde' :'
   bilder');
 *  $text = $ret_words . ($imagecount > 0 ? ' og ' . $ret_images : '');
 *  if( !$display ) {
    return $text; }
 *  echo $text;
    } ?>
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [How to exclude smileys from image count…](https://wordpress.org/support/topic/how-to-exclude-smileys-from-image-count/)
 *  Thread Starter [doffer](https://wordpress.org/support/users/doffer/)
 * (@doffer)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/how-to-exclude-smileys-from-image-count/#post-220295)
 * The regex is just messy to me, but the only thing I need is to exclude is the
   smiley directory… If someone could just add a line to make it work, I would be
   very happy, since I’m no hacker/coder my self 🙁

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