Add to Technorati Favorites


If You Liked That ~ plugin

Version 1.3 of the plugin is now available. This new version is compatible with WP 2.3 and takes on board many of the comments that I have received ~ keep the feedback coming.

You can download it from here.

I’m always looking for suggestions on I can improve things, any suggestions for amendments to If You Liked That will be gratefully received.

Please post any comments below…..

Posted in Wordpress |

73 Responses to “If You Liked That ~ plugin”

  1. Arno Smit Says:

    Dear Martin,

    I like the plugin, simple and easy to install. It works great with posts but…
    With pages it shows up like it should but when i click a suggested link i get an Wordpress database error.
    I’m no expert so can a repair that with a reinstall,

    Thanks Arno

  2. bochgoch Says:

    Sorry to hear that Arno,

    If you email me you site details I’ll take a look!

  3. Jaynee Says:

    It’s a great plugin - but when I try to limit the categories on which the plugin will be used, I get an error message in each post. How exactly am I supposed to type in the category names I want to omit? Should there be spaces after the commas, no spaces after commas, no spacing whatsoever, etc.? I really only want this to be used with FOUR of my categories rather than all 20-25. Other than that, it’s a great plugin that was easy to install!!

  4. bochgoch Says:

    Jaynee, Glad you like it!

    Sorry, it’s not very well labelled, you actually enter the category id number, so to exclude posts in categories two and eight you simply enter: 2,8

    Should work for any number of categories. You can find out the category id number in your admin panel under Manage | Categories, first column to the left.

    I’ll improve the labelling on the next version.

  5. kristarella Says:

    Good idea, I’ve been looking for something like this, but for my sidebar… would it work in a widget form?

  6. bochgoch Says:

    Thanks kristarella , My new plugin What’s New What’s Fresh What’s Happening (out soon) will provide links from the sidebar (on any page WP and non-WP).

    Must admit I’m not completely au fait with widgets … more reading up for me!

    I think I can feel version 1.2 of If You Liked That coming…

  7. degra Says:

    Hi! Great plugin, and it works very well!
    But I wonder if it’s possible to choose where the list must appear.
    I mean, I would to show the “if you liked that” stuff at the very end of the loop, even above the author, category, comment count, technorati tags, etc. and not just after the content.
    It’s possible (maybe in future?) to do this?
    Thanks!

  8. degra Says:

    Ops… I intended to write “below”, instead of “above” :)

  9. bochgoch Says:

    Thanks for the suggestion degra,

    I be working on a new widgetised version of the plugin shortly, I’ll certainly add some new hooks that will allow selection of alternative places to place the list as well.

  10. Wouter Says:

    Hi, I like your plugin and I have integrated it on my website.

    The only two drawbacks I have found up till now is
    1) It only searches for related posts in the same category. Maybe it would be an idea to put in an option so you can choose that it searches your whole blog instead of just the category the post is placed in?
    2) There is no option (yet?) to choose to order the links according to relevance

    Keep up the good work!

  11. bochgoch Says:

    Glad you like it Wouter …thanks for the feedback.

    At the moment If You Liked That is a simple little plugin that merely selected posts from within the same category as the displayed post. I can certainly see the value of a plugin that provides the same functionality, but with a blog-wide search. I could then introduce concepts such as relevance & related sorting. Another one for the work-list.

  12. Wouter Says:

    Thanks for your prompt answer! I would be very glad to see you further develop the script because it’s the best one I have found up till now. Maybe another one for the work-list: I have deleted the date/time/writer information from the list. I did it by hand in the source code. It would be great to have this as a menu option too! Thanks again.

  13. Bryan from SF, CA Says:

    I’m trying to change the color of the line that says “If you liked that…” — where would I do this?

    Thanks! This plugin is great!

    Bryan

  14. bochgoch Says:

    Thanks Bryan, glad you’re a fan ;)

    Easiest is to edit the style sheet (Presentation | Theme Editor | Style Sheet / style.css), add the style below:

    #ifyoulikedthat h3
    {
    color: #xxxxxx;
    }

    Replace #xxxxxx with your selected colour.

  15. Bryan from SF, CA Says:

    thanks, worked like a charm!

  16. Fudge Says:

    Thanks for that great plug in! I’ve been looking for something like this for ages.
    It works perfectly, except for one thing… “The line: If you liked this,….” doesn’t show and I have no idea how to fix it. Any suggestions?

    Thanks a lot in advance!

  17. bochgoch Says:

    Fudge, probably something to do with the styles you have on your site, post here or email me a link to your site with the plugin running and I’ll take a look….

  18. Fudge Says:

    The plugin is running, you’ll find it right here on my blog. Thanks a lot for your help!!!

  19. bochgoch Says:

    Fudge – a styling problem similar to the one Bryan had above … Your <h3> elements are set to white so you can’t see the text (white on white).

    Easiest is to edit the style sheet (Presentation | Theme Editor | Style Sheet / style.css) and add the style below:

    #ifyoulikedthat h3
    {
    color: #xxxxxx;
    }

    …change #xxxxxx to your selected colour.

    Good Luck!

  20. rilwis Says:

    Thanks for your greate plugin.

    But how can I do if I want to put the related links below the comment-box?

  21. rilwis Says:

    Thanks for your great plugin.

    I’ve found that we can change some code to put the related links anywhere we want.
    Just add global variable $iylt_show inside the function if_you_like_that() and instead of returning $content .= $ifyoulikedthatHTML, we asign $iylt_show = $ifyoulikedthatHTML and return $content.
    So, now we can put related links anywhere by put PHP code

  22. bochgoch Says:

    Thanks for the tip rilwis :)

  23. Stev Says:

    Hello, It’s great plugin but can please anybody help me putting it below my commentbox? I don’t understand te eplanation of Rilwis..Thanks!

  24. bochgoch Says:

    Stev, You need some knowledge of PHP to follow rilwis’s tip.

    The new version of the plugin (out when I get a chance to write it) will provide more flexibility in placement and will not require code changes … out soon(ish)

  25. Stev Says:

    Thanks for your reply. Hopefuly you will find some time…;-)

  26. catpaw Says:

    Love the plugin - just what the site needed for that extra something

  27. lewis Says:

    Oops not sure what I did but by enabling the related post mod to work as well it now no longer displays If you like that on category pages but works fine on single posts.

    Go figure :)

    Lewis

  28. Dave Says:

    I love your plugin. But I just upgraded to wordpress 2.3. And the plugin no longer works. Are you working on an update for your plugin?

  29. bochgoch Says:

    Thanks for the feedback Dave, I’ll see what I can do to fix it.

  30. clockwork Says:

    hi bochgoch, i love your plugin, and my problem is same as Dave, “if you liked that” can’t work at WP 2.3. and the error info says that the 2.3 DB was del the “post2cat” table. hope it’s useful to you.

  31. lewis Says:

    This is positivly one of the best plugins.

    Love the fact that I am using the wp-email plugin and when I post an article to my blog my subscribers receive the current posting along with at the bottom of the post via e-mail If You Liked That …

    However I seem to have one problem .

    Although I toggled Select if links are only posted on single post pages = Y when you go to a category page it still lists for every post in the category the If You Liked That …

    is there a way to fix this ?

    Sincerely,
    Lewis

  32. bochgoch Says:

    Lewis — I can’t quite replicate that problem, do you have an example I could look at?

  33. Sheridan Says:

    Please Fix it, i love it

  34. bochgoch Says:

    Quick Fix for Wordpress version 2.3 only

    The database changes for 2.3 are pretty murderous to this plugin. I’ve got a new version of the plugin on its way in a couple of days, in the meantime, a quick fix!

    Open if_you_liked_that.php and find the line of code:

    $ifYouLikedThats = $wpdb->get_results("SELECT t1.ID, t1.post_title, t1.post_date, t1.post_content, t3.display_name FROM $wpdb->posts t1, $wpdb->post2cat t2, $wpdb->users t3 WHERE t1.ID=t2.post_id AND t1.post_status = 'publish' AND t1.ID != ".$post->ID." AND t2.category_id IN (".$INcat.") AND t2.category_id NOT IN (".$excludeCategories.") AND t1.post_author = t3.ID ORDER BY ".$orderBy." LIMIT ".$numPosts);

    …and replace it with:

    $ifYouLikedThats = $wpdb->get_results("SELECT t1.ID, t1.post_title, t1.post_date, t1.post_content, t3.display_name FROM $wpdb->posts t1, $wpdb->term_taxonomy t2, $wpdb->term_relationships t4, $wpdb->users t3 WHERE t1.post_status = 'publish' AND t1.ID != ".$post->ID." AND t1.ID=t4.object_id AND t4.term_taxonomy_id = t2.term_taxonomy_id AND t2.taxonomy = 'category' AND t2.term_taxonomy_id IN (".$INcat.") AND t2.term_taxonomy_id NOT IN (".$excludeCategories.") AND t1.post_author = t3.ID ORDER BY ".$orderBy." LIMIT ".$numPosts);

    New whistles and bells version out soon!

  35. Wordpress 2.3 compatibility | Bochgoch Blog Says:

    […] Temporary fix for If You Liked That plugin running under 2.3 published ~ new version coming soon! […]

  36. Sheridan Says:

    You are the best. Thanks

  37. Dave Says:

    I try to make the change and it don’t work for me. I will wait for you new and improved version.

  38. Fernando Says:

    Hello, the temporary correction does not work for me. Wordpress shows the following error:
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AND t2.term_taxonomy_id NOT IN (-9999) AND t1.post_author = t3.ID ORDER BY ran’ at line 1]. Hope this will be useful.
    Thanks

  39. bochgoch Says:

    Thanks for all the kind words and feedback, it makes work on these plugins worthwhile. The new version 1.3 is available now! The link to the download page is at the top of this post.

  40. degra Says:

    Hi Bochgoh!
    I’ve just downloaded and installed your plugin, and I’m pleased to see that you have added the option for positioning the output (as I’ve asked some time ago).
    But in my blog it doesn’t show anything in both index page and single post page if I set the position to “embedded”.

    Thanks

  41. bochgoch Says:

    degra, it sounds like you haven’t provided an anchor for the embedded text. The embedded text relies on a piece of text or html within the post after which it will be appended. It’s easiest to place an HTML comment as the anchor within the body of the post, the default value when the plugin is installed is… <!–IYLT HERE–> place that in the post where you want the links to embed.

  42. degra Says:

    Ah… I’ve not understood this before… I’ve used the anchor, but not in the post…
    So it works only in the post body and not in the entire loop?
    Thank you for your answer!

  43. bochgoch Says:

    degra, the embedded option works only in a post and not within the loop … stands to reason really - if you want your links embedded within a post you have to tell WP where to embed it as every post is different.

  44. rino Says:

    Hi Bochgoh!
    Love this plugin! I had a minor booboo in the options menu and it didn’t work the first time, but I read carefully the instructions and it turned out I wrote the category name instead of the number only. I changed it and voila, it worked. Very good!

  45. stev@ Says:

    Same problem here. It would be great when it works in a loop. It”s almost impossible to ad this to every post.

  46. bochgoch Says:

    Sorry my response has taken so long - been tied up with other things.

    To address a general query…

    The embedded option is only for use in very specific circumstances … if you don’t want to edit or insert the anchor into every post, then use the before, after or widget options.

  47. Cool Plugins for your Wordpress Blog » i-TONG Says:

    […] If You Liked That ~ plugin - Following the content of a post, this plugin inserts links to a user selectable number of other posts in the same category as the main post. By bochgoch […]

  48. lewis Says:

    Hi,
    Looks like this is exactly what I needed but is it possible it does not work with all themes ?
    Installed and activated it on my wordpress 2.23 version but it never appears .

    Is this related to the specific theme I am using ?

    Best,
    Lewis

  49. bochgoch Says:

    Lewis, are you running as a widget - you need to make sure that the sidebar (or whereever) that the widget is placed runs after the loop. That usually means placing the widget in a right sided sidebar or the footer.

    Let me know the theme and site and I’ll take a look…

  50. Onur Pay Says:

    Hi Bochgoch,
    thanx for a great/easy/fast plugin. Just wanna ask something about “sentence” thing. When i post an entry that begins with an image, plugin shows only a “.” for first sentence. So what about two sentences? or three? im not a php guru so i couldn’t find it. if there is a solution i will be glad to see.. Thatz all. Thanx again for a good plugin.
    cheers..

  51. bochgoch Says:

    Cheers - That is a problem, I’ll rework the whole sentence logic shortly.

  52. Lon Says:

    I love the plugin… only thing is, that there’s this gigantic gap between the title of ‘if you liked that…’ and the random posts that follow. yours doesn’t seem to have a gap, is there any way of fixing this?

  53. bochgoch Says:

    Thanks Lon,

    A bit of css trickery is required to remove the gap, you’ll need to amend the #ifyoulikedthat h3 style. Easiest is to edit the style sheet (Presentation | Theme Editor | Style Sheet / style.css) and add a style similar to below:

    #ifyoulikedthat h3
    {
    margin:0;
    padding:0;
    }

  54. Inge Says:

    Hello Bochgoch,

    Excellent plugin. Just what I needed. Two questions:

    1: On the basis of which criteria are related posts selected?
    2: How can I alter the exact make-up of the message? The h3 works fine, but the body text and links (such as on http://www.eclectro.nl/2007-09-09-tecktonic-dance/) look different (other font, other size).
    3: There’s unnecessary space between the last link and the rest of the footer. How can I remove this?

    Thanks in advance!

  55. bochgoch Says:

    Inge,

    1. Just by category at the moment - I’ll work on a new version when I get a chance that works with WP’s new taxonomy stuff.
    2 & 3. CSS is the way to get a consistent look - the structure is basically:

    <div id=”ifyoulikedthat”>
    <h3>Your Title</h3>
    <p><a href=”#” rel=”nofollow”>Selected Link</a></p>
    </div>

    …style those elements to your hearts content :) There are a few examples above. You’ll need CSS to style …

    #ifyoulikedthat div { your style goes here };
    #ifyoulikedthat h3 { your style goes here };
    #ifyoulikedthat p { your style goes here };
    #ifyoulikedthat a { your style goes here };

  56. René Says:

    Hello,
    I put your website in my WP-blog but there is a strange behaviuor.

    In the index of the website I see the related items (Articoli correlati, in Italian).

    How I can fix it? I put the code <!-- IYLT HERE --> only in single.php but I see in index too.

    Thank you for your help

  57. bochgoch Says:

    Rene, No need to amend any code as IYLT works with Wordpress hooks to insert itself into your blog. I suggest you use the After the post and Show links only on single post pages options to stop the links appearing on the index page.

  58. Bob Carney Says:

    It seems to have disappeared. I first started by embedding it and then changed it to the “after the post” and now its no longer there. I have uninstalled it and reinstalled to see if that was the problem. Do I need to write something on the single.php?

  59. bochgoch Says:

    Bob, not sure what the problem is - I’ve tried accessing your blog but it’s not loading - no need to change single.php…

  60. Inge Says:

    @ bochgoch: thanks for your elaborate reply. Nevertheless I’ve already switched to another plugin ([edit ~ a little cheeky inge posting a link to another plugin :)]), since it gives better related results. Good luck with your own!

  61. Bob Carney Says:

    Thanks…I am thinking it has something to do with me changing Categories to Tags on WP. I have went back to add tags to a few of them and they appeared. Thank you.

  62. Plugin do WordPress para posts relacionados | blog palmeirense falador Says:

    […] um plugin que usasse as categorias do blog como critério de exibição e não deu outra, o “If You Liked That” do Bochgoch Blog é perfeito, simples de tudo, tanto de instalar como de […]

  63. SEO Plugins für WordPress-Update 2008 Says:

    […] If You Like That […]

  64. josh Allan Says:

    I’m using WordPress 2.3.2 with K2; I’d like to make the “If you liked that” font smaller and adjust the spacing between the links as well. I’ve looked through all the comments above and tried entering the code you recommend into my style.css but it’s not changing anything! Any insight would be greatly appreciated! Love your work…

  65. Jaap Says:

    Hi bochgoch,

    Just implemented your plugin. I figured somebody had to have made a plugin like this one. As a future feature, I’d suggest a ‘limit’ functionality (like i’ve read here). I tried limiting the categopries, but that didn’t work as expected: those categories got left out. Which is also a good feature, ofcourse :) .

    I also edited your plugin to display 100 charcters and stop at the first space, instead of your method. Since most of my posts contain an image at the start, no first line was shown. I changed
    $postSentence = ''.strip_tags($pieces[0]).'.';
    to read this:
    $postSentence = ''.substr(strip_tags($ifYouLikedThat->post_content),0,strpos(strip_tags($ifYouLikedThat->post_content),' ',100)).'...';

    Besides that, I cut out the style and tried matching it with my current theme.

    Really love what you did, clean and easy plugin. Customizing it just took me 10 minutes. Thanks!

  66. gofree Says:

    Have been using this great plugin for almost half a year by now; and would like to see the update for the following:
    1. Automatic detection of the posts in the same categories and parts of the titles
    2. An option to also include the some description from the posts with words limitation
    3. An option to also assign to open the links in a new widows/tap
    4. An option to style the texts.

    Waiting forwards to seeing your update soon.
    Thx

  67. gofree Says:

    It would be great if you can also add more features: Show posts in the same category, similar title, tag. And custom field to also add a link to it.
    Thx

  68. gofree Says:

    Opp one more thing, your this plug-in conflict with this:
    http://pixelplexus.co.za/blog/2007/11/20/plugin-to-change-wordpress-post-order/

    Please, kindly check it out.

  69. shobhit Says:

    Hi,
    At the moment it dispaly automatically just after the post text. I want to display at the end of my post as per my choice. Is it possible to define a place in template( single.php)

    Thanks
    Shobhit

  70. Doug Winship Says:

    This plug in is exactly what I want for a series of posts I’m doing.
    I’ve installed it. Activated it. I’m using the embed option, and using the default HTML, which I copied and pasted into my posts.
    And I see nothing! What am I missing?
    sample post: http://www.killingtime.com/Pegu/?p=224

  71. bochgoch Says:

    Thanks Doug,

    Couple of things to check … have you selected Embedded in the post as the Positioning of the linked posts option?

    …When you paste the anchor <!–IYLT HERE–> into a post you need to be in Code view in your editor - the Visual view will translate that HTML comment and stop the plugin from picking it up.

  72. Lon Says:

    this plugin was working for me a while ago, but i’m not sure how long ago, it stopped showing up on the blog. it’s activated, and configured, not sure what’s wrong.

  73. Lon Says:

    also, it seems to work from feedreader, but doesn’t show up on the blog itself.

Have your say