Some users of the plugin “I Like This” asked me how to custom the style. So, here’s a little tutorial to do what they generally want.
First, you have to know that the file used for styling the plugin is /wp-content/plugins/i-like-this/css/i-like-this.css. If you make any modification in this file, be careful about the updates! Don’t do an auto-update via the administration, your file will be erased! Backup this file and upload next updates manually (without replacing it, of course).
Instead, you should keep this file unmodified and add the following properties in the style.css of your template.
How can I increase the font size?
Add the property font-size to the class .iLikeThis
.iLikeThis {
font-size: 1.5em;
}
You can obviously change the value as you want, 1em is the normal value.
How can I put the counter near the post title?
For this customization, you have to do some modifications in your theme. Go to your theme folder and choose the template you want to customize: index.php, single.php, archive.php or search.php (for more information, see Wordpress Template Hierarchy).
Place this code <?php if(function_exists(getILikeThis)) getILikeThis('get'); ?> right before the post title, like this:
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php if(function_exists(getILikeThis)) getILikeThis('get'); ?>
<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
(...)*
</div>
* Here is others lines of code to display your post content, but you don’t need to change them. Note that this example use the original WordPress theme.
You can now make some changes in our CSS file by adding a float property to the class .iLikeThis, this will put it right from the title. I also added a background-color, a padding and some border-radius properties — for rounded corners — but it’s not essential.
.iLikeThis {
float: right;
background-color: #ccc;
padding: 10px;
border-radius: 5px;
-khtml-border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
If it doesn’t work, the theme Smooth has this style. Try to download it and look at the source code to understand.
How can I change the images?
Simply replace the files in wp-content/plugins/i-like-this/css/. If you choose an image bigger than 16×16px, it will be cropped. I’ll not give an example for that because it’s different for each image.
Need support? Have a question? Check out our support center.
22 Comments
ercan
Feb 27th, 2010 @ 8:53 pm
thank you very much for this great plugin but i need your help, i want to use “i like this” widget with my own design, so can you please give me the code which is pointing your widget… (for ex. like this; )
LeBen
Feb 27th, 2010 @ 8:56 pm
Did you read the FAQ first? ;-)
http://wordpress.org/extend/plugins/i-like-this/faq/
Aaron Grey
Mar 2nd, 2010 @ 7:16 pm
Thanks for creating a wonderful plugin. I’m pondering using it on a site I’m creating. I looked over the readme and I see how to display posts without the widget, but I was wondering if it’s also possible to display most liked posts by category or perhaps by tag. Thanks!
LeBen
Mar 3rd, 2010 @ 2:08 pm
@Aaron Grey You’re welcome. Unfortunately you can’t add a filter to the widget at this time. I’ll maybe add this feature in a future release.
Aaron Grey
Mar 3rd, 2010 @ 6:52 pm
Thanks for the quick response. I’ll check back often for updates to this plugin. Keep up the good work. Thanks!
Boyan Kostov
Mar 3rd, 2010 @ 10:22 pm
For me that’s the killer of all other post rating plugins out there – slick, simple and stylish. I use it and I really think it’s terrific. Thanks for the great work.
João
Mar 9th, 2010 @ 2:14 am
hello :)
this seem a really great plugin :) thankyou :) i am also using one of your themes, great work, thanks again :)
i have a question, how can i place this plugin only at the end of the post or just at the top? thank you :)
LeBen
Mar 9th, 2010 @ 8:20 am
@João You have to disable the “automatic display” under Settings ➜ I Like This. Next time, please use our Support Center.
jocke
Mar 10th, 2010 @ 7:23 pm
Thanks for this excellent plugin.
My only question: Is it possible to generate a text instead of the + “button” when it disappears?
I have erased the + button and replaced it with the heart image so that you click the heart instead of the + image. But it looks weird with just a number after you have clicked it. If i could display another image or a text string like “likes this” after the number it would be great!
thanks!
LeBen
Mar 11th, 2010 @ 9:16 am
@jocke Yes, it’s possible but you have to make some changes in the core. I’ll not explain you how, if you have the skills for, you’ll find ;-)
Next time, please use our Support Center.
matt
Mar 13th, 2010 @ 1:26 pm
hello! thanks for your wonderful plugin. however, i’ve got trouble trying to make it work at http://www.polkadotmonsters.com. i’ve enabled only one copy of jquery and also set the file permissions as advised from the support center. the problem is, once the post has been liked by 1 person, the counter stays at 1. the next person who comes along only sees the heart graphic and the count (which is 1). unable to click to like the post and add to the count. what may be the problem? i really cant figure it out, but your plugin is probably my best bet in getting this function working. thanks!
LeBen
Mar 13th, 2010 @ 1:59 pm
@matt I’ve just voted for one of your post and it worked. I Like This check your IP before accepting the vote. If you use the same computer or another computer with the same IP address, it’s normal.
matt
Mar 13th, 2010 @ 2:09 pm
i see. so it’s to do with the IP. thank you very much!
Iskandar
Mar 19th, 2010 @ 3:35 pm
I love the simplicity of this plugin.
It’s easy to install, and breeze to vote. It’s working wonderfully at my site.
Thanks LeBen.
dedeismus
Mar 23rd, 2010 @ 12:55 pm
Awesome thank you :)
One question, how can I display the “comments count” to this? like on the Preview Picture?
thanks for a feedback
greez dedeismus
João
Mar 26th, 2010 @ 1:45 am
is it possible to apply this to a normal html page?
LeBen
Mar 26th, 2010 @ 8:06 am
@João ??
João
Mar 26th, 2010 @ 10:17 am
like, implement this in a non wp page, for example, i’m building my personal portfolio in html, and i would like to have this there, is there any way of doing this? or is there some kind of similar script?
thank you ;)
LeBen
Mar 26th, 2010 @ 11:19 am
@João This is a plugin for WordPress. That’s all. Use WordPress to build your portfolio if you want to use I Like This.
João
Mar 26th, 2010 @ 1:19 pm
Thank you, i might do that, your plug-in is really nice ;)
Thank you for your themes and plug-in ;)
Daganl
Mar 27th, 2010 @ 12:06 am
I was just wondering it it were possible to just display the “like count” only. I want it on my excerpt pages to just show the count, only on the actual post page will it have the ability to “like it”.
LeBen
Mar 27th, 2010 @ 9:25 am
@Daganl Sorry, it’s not possible.