WordPress.org

Ready to get started?Download WordPress

Forums

Problem When Changing Smileys in 2.5.1 (4 posts)

  1. skippysandy
    Member
    Posted 6 years ago #

    I downloaded a set of new emoticons to use on my blog, and rather than take the time to rename all the files (and save them all as GIFs) I went straight to uploading them in the wp-includes/images/smilies/ folder, and then editing the functions.php file in the wp-includes folder. I have done this before, with an earlier version of WordPress, so the process is familiar to me. However, now that I've changed the functions.php file my site is not displaying: it shows up as a blank page, as does my WP dashboard. I looked thoroughly over what I changed and cannot find any obvious problems, so I thought I could use some help.
    Is there anything that can't be added into this file? All I did was edit the smiley array, such as:
    '0:-)' => 'angel.png',
    '0:)' => 'angel.png',
    '>=(' => 'angry.png',
    etc., though I kept the structure intact. Are there any characters that are now allowed, or some common error I am unaware of where this file is concerned? I haven't tried to change the smileys since I had WP 2.3; is there something else I have to do in WP 2.5.1?
    Any help would be very appreciated: thanks! :)

  2. It's generally a good idea to not edit the core WordPress files, as you'll quite likely have to redo your changes when you upgrade WP, or as you've seen, things can go wrong.

    I suggest you restore the original of functions.php, then add your smiley array to config.php. That way, it won't break the core files, and you won't have to fix it every time you upgrade. You need to add the array just above the last line of the file, so it looks something like this:

    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    $wpsmiliestrans = array(
    '0:-)' => 'angel.png',
    '0:)' => 'angel.png',
    '>=(' => 'angry.png'
    )
    
    require_once(ABSPATH . 'wp-settings.php');
    ?>
  3. sn315on
    Member
    Posted 5 years ago #

    Thank you for posting that, it helps out in the long run! :)

    Sara

  4. hierogliefje
    Member
    Posted 5 years ago #

    Good idea to put it in the config.. but finish the array with ; or you won't be smiling ;)

    $wpsmiliestrans = array(
    '0:-)' => 'angel.png',
    '0:)' => 'angel.png',
    '>=(' => 'angry.png'
    );

Topic Closed

This topic has been closed to new replies.

About this Topic