How to use smileys in WordPress

Aug 16, 2013, by admin

WordPress Smileys

In the post we are going to see how to manage the smileys in blog posting in WordPress hope it will be useful to you all

What Is Smileys ?

Smileys, also known as “emoticons,” are glyphs used to convey emotions in your writing. They are a great way to brighten up posts.

How to turn off graphic smileys ?

f you turn off graphic smileys, whatever you type in plain text will remain, and be displayed, as plain text.

  1. Go to your Admin Panel
  2. Select Settings -> Writing
  3. In the Formatting section, uncheck the box for “Convert emoticons like 🙂 and 😛 to graphics on display

Texts to Make Smileys?

How Can I Have Different Smiley Images Appear?

The easiest way is to filter the smilies.

Upload the images you want with the same name to your server (say in wp-content/images/smilies) and put this in your theme’s function.php:

add_filter(‘smilies_src’,’my_custom_smilies_src’, 1, 10);

function my_custom_smilies_src($img_src, $img, $siteurl){

return $siteurl.’/wp-content/images/smilies/’.$img;

}

 Smiley CSS

The smiley images in WordPress are automatically given a CSS class of wp-smiley when they are displayed in a post. You can use this class to style your smileys differently from other post images.

For example, it’s not uncommon to set up images in a post to appear on the left-hand side of the content with text flowing around the image. The CSS for that might look like this:

.post img {
    float: left;
}

This would typically affect all images in a post, including your smiley images. To override this so that smileys stay inline, you could add this to your CSS:

img.wp-smiley {
    float: none;
}

For more on CSS in WordPress, you might want to start here.