[How to] wp_grins in 2.1
The old instructions won’t work for 2.1, as a number of changes have been made.
To get your clickable smilies into the edit page, you now need to edit wp-includes\general-template.php. As of the latest RC code, look around line 825 for:
On a new line below this, add:
<?php if (function_exists('wp_grins')) wp_grins(); ?>
Save and upload the file, making sure you kept a copy of the unedited version.
The next change is because of the way smilies are being translated. Amongst other things, if your codes are not surrounded by spaces, they may not become smilies in your posts. To fix this, you need to edit wp-grins.php, so that it pads the smiley codes with spaces. Find line 34 and change it to this:
$grins .= '<img src="'.get_settings('siteurl').'/wp-includes/images/smilies/'.$grin.'" alt="'.$tag.'" onclick="grin(' '.$tag.' ');"/> ';
The only change (other than the same change of path needed for WP 2.0) is that this will insert spaces before and after the value of $tag.
This won’t help with old posts and comments – their smilies may or may not appear, depending on spacing, and other factors.
- The topic ‘[How to] wp_grins in 2.1’ is closed to new replies.