Title: wp_grins
Last modified: August 18, 2016

---

# wp_grins

 *  [agara](https://wordpress.org/support/users/agara/)
 * (@agara)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/wp_grins/)
 * I want to know “how to use wp_grins”

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

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/wp_grins/#post-140497)
 * What is it you are stuck on ?
    And with which version of WP ?
 *  [lokrin](https://wordpress.org/support/users/lokrin/)
 * (@lokrin)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/wp_grins/#post-141028)
 * I’ve a question – Is there anyway to sort the grins? I’m not sure what order 
   they are appearing in, but it is always the same order but not the one listed
   in vars.php or in the smilie directory itself.
 * I have a lot of smilies and would like to group them in things like
 * standard smilies
    flags computer etc
 * (or, possibly just alphabetize them)
 * btw – using wp1.5
 * Thanks
 * 🙂 <- What? No smilies here? 😛
 *  [jennmiller](https://wordpress.org/support/users/jennmiller/)
 * (@jennmiller)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/wp_grins/#post-141076)
 * I know this is an old topic, but has anyone come up with a way to sort smilies(
   grins) yet? I’ve been searching, but I have no idea how to change the output 
   or array or whatever we need to do.
 *  [maryafernanda](https://wordpress.org/support/users/maryafernanda/)
 * (@maryafernanda)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/wp_grins/#post-141098)
 * I also would like to know if there’s a way to sort grins… I’ve grins from different
   styles, and I’d like to separate them in groups…
 *  [alexkingorg](https://wordpress.org/support/users/alexkingorg/)
 * (@alexkingorg)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/wp_grins/#post-141099)
 * They are sorted in ascending alphanumeric order (php default) by abbreviation.
 *  [maryafernanda](https://wordpress.org/support/users/maryafernanda/)
 * (@maryafernanda)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/wp_grins/#post-141110)
 * Mine are not… For example, I have an icon named :Jsomething: listed before an
   icon named :Asomething: …
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/wp_grins/#post-141111)
 * I think Alex means like this ?
    [http://akizuki.org/wp-images/smilies/](http://akizuki.org/wp-images/smilies/)
 *  [maryafernanda](https://wordpress.org/support/users/maryafernanda/)
 * (@maryafernanda)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/wp_grins/#post-141112)
 * Th e smilies don’t get sorterd by the actual :code: neither by the name of the
   file itself (“icon.gif”). As you may see at my comments page ([http://akizuki.org/2005/05/09/poster-gof](http://akizuki.org/2005/05/09/poster-gof)),
   they really don’t get sorted in any particular order….
 *  [lbessant](https://wordpress.org/support/users/lbessant/)
 * (@lbessant)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/wp_grins/#post-141113)
 * Actually, they *do* get sorted. Just not in a way that makes a lot of sense[1].
   If you look in vars.php, below the smilies array, you will see this block of 
   code:
 * `// sorts the smilies' array
    if (!function_exists('smiliescmp')) { function 
   smiliescmp ($a, $b) { if (strlen($a) == strlen($b)) { return strcmp($a, $b); }
   return (strlen($a) > strlen($b)) ? -1 : 1; } } uksort($wpsmiliestrans, 'smiliescmp');
 * Looks to me like it’s sorting first by the *length* of the string, then alphabetically
   for strings of the same length. Looking at my smilies confirms that this is what
   is happening.
 * I’m going to try commenting out the sort, and seeing what happens….
 * EDIT: Yup. Commenting out that block causes the smilies to be displayed in the
   order they are listed in vars.php. So for anyone who wants them in a particular
   order, editing the list should do the job. (This was with 1.5.1)
 * [1] To me, anyway
 *  [maryafernanda](https://wordpress.org/support/users/maryafernanda/)
 * (@maryafernanda)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/wp_grins/#post-141117)
 * Thanks lbessant! 🙂

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

The topic ‘wp_grins’ is closed to new replies.

 * 10 replies
 * 7 participants
 * Last reply from: [maryafernanda](https://wordpress.org/support/users/maryafernanda/)
 * Last activity: [21 years, 3 months ago](https://wordpress.org/support/topic/wp_grins/#post-141117)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
