I have been using Darren’s Related Posts plugin (DRPP) for a long time. For my purposes it was the best plugin for showing related posts that I had encountered. After a while I decided that I was not completely satisfied with the way that it seemed to favor more recent posts. I developed a new algorithm that I felt would not give preference to newer posts unless they were actually more related.
When I learned that WordPress would be adding native tag support in version 2.3 I decided that I would create my plugin to work with tags after they arrived. Life got busy so I never worked on the plugin until version 2.5 came out (partly because I wanted to convert the post_meta “keywords” from DRPP to tags). I finally buckled down and created my Similarity plugin this week. I have tested it on version 2.3.3 and version 2.5 (I assume it will work with any version of 2.3). I will continue to test it on new versions of WordPress as they are made public. (Przeczytaj opis wtyczki po polsku)
Latest Version 2.13.1 (September 9, 2009)
New options make it possible to layout and style the php function generated lists (for sidebars) independent of the auto-generated list. – Version 2.13 was released with an incomplete development copy of the plugin so it did not have the promised functionality. (In other words, “Pay attention Miller.”)
To install it simply unzip the file linked above and save it in your plugins directory under wp-content. In the plugin manager activate the plugin. Settings for the plugin may be altered under the Similarity page of the Options menu (version 2.3) or Settings menu (version 2.5 or later).
Options include:
- Number of posts to show – this is a maximum, it won’t invent connections that don’t exist, set it to 0 (or less) and it will display all matches.
- Minimum match strength – enter a number between zero and one (one being a perfect match) and items related weaker than the number indicated will not be included – this limit is ignored for the one extra if that option is used.
- Default Display if no matches – if there are no matches this is what will be displayed, this is not displayed if there are matches, but fewer than the set maximum.
- Text and Codes before the list – assuming you want to do a list this is where you would place the <ul> or <ol> You may also place any other code you would like to have preceeding the list. (There are two boxes here – one for function calls in your template and one for auto-generated lists.)
- Text and Codes after the list – this would be the place for </ul> or </ol> You may also place any other code you would like to have following the list.(There are two boxes here – one for function calls in your template and one for auto-generated lists.)
- Output template – this would be where you place the <li> tags. (There are two boxes here – one for function calls in your template and one for auto-generated lists.) There are also 4 template tags you may use (in any configuration you can imagine) to define how the results are displayed
- {link} – provides a link – equivelent to <a href=”{url}”>{title}</a>
- {strength} – outputs the calculated degree of relatedness
- {url} is the permalink for the related post
- {title} is the title for the related post
- Display format for similarity strength – Value displays the {strength} in a decimal format (0.873), Percent displays the {strength} in a percentage format (87.3%), Text displays {strength} as a word (Strong, Mild, Weak, and Tenuous are the defaults), and Visual displays a color block (Green for 100% fading to Yellow and then to Red for weak connections)
- Relative mixing weights – these values determine the ratio given to the weight of tags vs categories when using the sim_by_mix function. Invalid ratios are treated as a 1 to 1 balance.
- Custom text for strength – allows you to insert custom text (including markup) for the strength indicator when using the text display format. (Hint: using markup allows for the possibility of showing custom images.)
- Show one more random related post – dig deeper into the related post list with one random selection (you can set a minimum strength for these random items).
- Auto-display a Similarity list at the end of a single post – without modifying any templates.
The plugin allows for three function calls anywhere in your page templates or their shortcodes in text widgets (all use the same options):
- <?php sim_by_tag(); ?> – determines similarity based on the tags applied to the posts (shortcode: SIM-BY-TAG)
- <?php sim_by_cat(); ?> – determines similarity based on the categories assigned to the posts (shortcode: SIM-BY-CAT)
- <?php sim_by_mix(); ?> – determines similarity based on the tags and the categories with the relative weights determined by the relative mixing weights setting (shortcode: SIM-BY-MIX)
Alternately you may choose to auto-display any of the similarity lists at the end of posts on single-post pages without getting into the php by selecting the function you wish to auto-display on the Similarity options page.
[…] Similarity Displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity Displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity Displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity Displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
I was using the Simple Tag Plugin for this purpose (based on tags) and I have some questions: is there a way to “mix” tags and categories similarity in a single list ? If you get a blog with a lot of posts, will be some problem of time to calculate the list ?
Thank you for eventual answers…
There is no way within this plugin currently to mix tags and categories. That was something I had considered doing in a future version. Knowing that there is some interest I will work on that – it’s a bit complex. On the question of performance, I really don’t know. I have never had nor heard reports of performance issues, but I have no data outside my own blogs. I have nearly 1000 posts now and have never had any issues with slowing. The performance probably also depends on how many tags are being considered – I have nearly 400.
Since you bring up Simple Tags I would like to share one important way that my algorithm is different than every other related posts plugin I have found (including Simple Tags) – mine gives more weight to less common tags (or categories) when calculating similarity. In other words, if two posts share a very rare tag they can get a higher similarity score from that than they do from sharing two very common tags (it depends on how rare or how common the various tags are). Most plugins calculate based simply on the number of tags in common (of course the number of shared tags is a factor in mine too).
Thanks to the question by Li-An I finally tackled the function to mix categories and tags in calculating similarity. Thus the release of version 1.3 today.
[…] Similarity displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
[…] Similarity displays a list of posts similar to the current post with similarity being determined based on tags or categories […]
Thank you for your quick answer … and what an answer ! 🙂 I was bored to create “artificial” tags in Simple Tags to create a list of related posts. I install your plugin right now !
It works great ! I wanted to create a french translation for the plugin but it does not manage .po and .mo files as I can see ?
I have not done anything with translation before. If you have any hints about how to make that possible I’m more than willing to look into it.
I believe that version 1.4 is prepared for translation now.
I tried to modify the weight of the tags to make them more important but the result (showing 5 links) is that it shows the same links two or three times for some posts !?!
That’s a problem. Early on in development I ran into a problem of having a post show up twice in the list but that appeared to be fixed before I released version 1.0. I’ll look into that.
This new problem was related to post revisions (which did not exist when I first created Similarity). It is fixed in version 1.4 as of 1/27/2009.
hi. Thanks for plugin
perfect.
Regards
I hope you enjoy it.
I have a suggestion for the showing of the strength. As I was a mathematic teacher, I know how hard it is to convert numbers into something clear to understand. I don’t know if it’s easy to to but maybe it could be interesting to show a colored image instead of a number (even a percentage :-)). Something like “green” for 100% to 70%, orange for 70% to 30%, red for 30% to 0%. It’s just an idea 🙂
You’ve given me an idea . . .
🙂 Let’s wait and see.
See version 1.5 😀
Well, you are a fast guy !
Great work !
A have some new philosophical question about the plugin: for the moment it shows the “best” posts for a category and chosen tags. But I’m afraid it’s always the same “good” posts that are shown and so, some posts will never be shown. I choose the random display with Simple Tags but your plugin is interesting because it shows the “best related” posts. Well, it was only some thinkings 🙂
Thank you again for your efforts.
The plugin actually randomizes among posts that are equally related. I wonder if it would make sense to randomize without considering degree of relatedness – I’d have to think about that.
Yes, I understand your point of view. For the moment I show 4 links. Maybe it could be nice to show the 3 “best” links and a “more random” 4th (not completely random, of course). I must admit I have no good solution (I thought I may use your plugin AND Simple Tags in the same time): if you show the “best” links it’s nice for new visitors but “old” visitors will already know the posts and it could be nice to make them discover something “uncommon”. It’s only ideas I got, maybe it has no sense.
There are other plugins that will display random posts from your archives but if you want one that is random but related I have an idea that could accomplish that. I’ll call it the “Plus One” option – when I implement it.
Hello,
Similarity ist the only Plugin that brings good results. The only problem is that it shows post that are not public or that are drafts. I have many of such and therefore I cannot use this plugin. How can I fix that? Or, will you fix this in the next update?
Thanks,
Der Kritisator
What version are you using? Versions 1.7 and 1.8 should hide private posts if you are not logged in. For users who are logged in private posts will show for the post author (meaning the author of the private post) or for users who have the ‘read private posts’ capability (usually admins). As of version 1.8 posts that are scheduled for future publication will not be shown.
If you are using the latest version and not logged in and are still seeing those posts please let me know so that I can look into that problem.
OK, that’ a solution. I use v1.8 and I’ll test this. Thank you for the help.
DK
Hmm, just test it. It doesn’t work anymore. When I am logged out, I can still see these posts. I use WP 2.7.1. A good example are two pages that don’t have any tags. I this case, Similarity “matches” the non-tags posts/pages (drafts) and dislpays it on the sidebar.
What can I do?
Thanks for help,
DK
If you are using the sim_by_cat or sim_by_mix calls there will be matches even without tags. I will look into this, but can you let me know if you are seeing private posts in your list, or are you just seeing drafts?
Ok, I’ve used . I’ll look for an other expression.
> but can you let me know if you are seeing private posts in your list, or are you just seeing drafts?
Pages across Posts. I just seeing drafts. But for me, drafts are not yet for public.
If you only want to match on tags use the sim_by_tag function (WordPress stripped the call you referenced in your comment so I don’t know what you have been using.)
I completely understand that drafts are not ready for public consumption – I just needed to zero in on the problem. I hope to have a solution soon.
Good luck for a solution and thanks for help.
I sent you the solution, but for future readers I will just say that the problem is solved in version 2.0.
Thanks for your patience.
“sim_by_tag” works without this specific problem. but, the “mix” brings better hits for me.
your plugin does not figure out proper permalink redirects, but points to default …?id=123 type of url.
🙁
My plugin just outputs the results of the get_permalink() function for each post in the list.
Hello,
thank you for the last version and the new option. But it seems the minimum strength works only for the “regular” posts not the random one ? (I send you the french translation)
I tried to state that the random post ignores the minimum strength parameter but perhaps I did not say that clearly. Thanks for the updated French translation.
Maybe it will be cool to have the option to choose a random post with a good strengthness. When there is a lot of related post with a good strength it’s a pity the random post is a one with a poor strengthness…
I can include that in the next version. (The more I think about it the better the idea sounds.)
Coooool 🙂
I have 80,000+ articles on my blog and added at least 30-40 new articles each day, I like this plugin and when installed on my blog my server going crash (over load process), already installed super wp cache but look like problem still persist.For temporary I deactivated this plugin, any tips for me guys?Thanks.
I can imagine that 80,000 articles would start to cause a performance issue, especially if you have many tags and categories and especially if you use the sim_by_mix function. If you are using sim_by_mix you might try using sim_by_cat or sim_by_tag. Also, I would suggest that you not use it on pages with multiple articles (archives, main page, or search results come to mind). Unfortunately I don’t really have any other suggestions since I have no sites with a database anywhere near that large.
Hello, David,
did you receive my mail with the translation and the problem I met ?
To Richard: I read that this kind of plugin need a lot of server processing and it’s not surprising you met problems. Maybe you can try some others (like Simple Tags) to see if it works better.
I have received the translation. The fix for the bug in the minimum strength for a random post is available from the Similarity link on this page (along with your updated translation files), but due to problems with the repository I have not yet been able to get the fix into the WordPress plugins directory.
Thank you for all your work 🙂 ! It works fine now.
Works great, thank you
Great plugin!
I use it on my personal website – wholly in Polish language – and works pretty good. Thank you!
But there is one small issue: when I turn on option to show random posts I see word ‘RANDOM’ as mark. How can I translate ‘RANDOM’ into Polish ‘losowe’? It seems that I have to make some hardcoding in similarity.php file.
IMVHO it would be great to have new option in settings of the plugin to put custom (here: Polish) word instead ‘RANDOM’.
There is a plugin called Codestyling Localization. If you install that on your blog it adds an item on the tools menu where you can create a localization file in Polish for Similarity (and many other plugins). If you do create a polish translation let me know and I will include it with Similarity. One of my users has used Codestyling Localization to create the French translation files that come with Similarity.
@David
Thanks for your reply.I put this function on page only.I already try with all functions but that’s not resolving the problem.Yes you are right there each article had 8-10 tags.
Maybe a lot hit on page caused high query on database.I got 20,000-22,000 visitors daily.
@Li-An
Thanks for your suggestion, unfortunately I don’t like Simple Tags plugin. 😀
Just to bad I can’t use great plugin like similarity, but I will be monitoring this plugin dev progress, maybe someday David found his magic to make this plugin working with “big boy” wordpress. 😀
Again good work and thanks for all reply.
There are some other plugins offering the same kind of related posts. Maybe you can test them 🙂
Thanks for the vote of confidence Richard. With that many posts and that many tags per post I’m not surprised that you would have performance issues. I’ll have to think about how I could make this work under those conditions.
Hi,
I am using WP 2.7.1, and plan to install you plugin and display it in widget area, should I just select text widget and paste into widget content?
Also, is it possible to disable the display of similarity in post area? Because it already display in widget.
TIA
Similarity does not automatically display in your post so there’s nothing to disable. If you want to use it in the widget area you can either place it before or after the widgets (you have to know your php) or else you can make sure you have at least version 2.3 of Similarity and use a shortcode (you can’t add php function calls to widgets as far as I know). The only catch with that is that I don’t know how it will function if you display it on a page that shows multiple posts and I don’t know if you can have a widget that only displays on single post pages.
The option to automatically display Similarity results and the ability to have shortcodes that only display on single post pages are coming in the next version.
Hi David,
Thanks for your prompt reply. For displaying in single post page, I must modify single.php in my theme and at the end, call another alternative sidebar.php which have your php insert code.
Looking forward to your new features in next release.
Meanwhile, I have implemented some alternative related posts plugins in my site, I hope it functions correctly.
BTW, what kind of plugins you use for your comments. It can show it in thread discussion. Very nice…
The new release is out with shortcodes that only show on single post pages. That should suit your needs.
As for my comments I use two plugins – “Subscribe to Comments” and “WP Ajax Edit Comments” but neither of them affects the threaded discussion – that’s a new feature in WP 2.7. If you have WP 2.7 or higher. You just need to make sure that your comment form makes a call to comment_id_fields(); instead of some older code. Let me know if you need help in trying to implement that.
Hello David,
Your Similarity plugin works great – thank you very much!
I have a question though: when I installed your plugin it worked fine in my (multiple) post page, but now it only works on single post pages. Any idea why?
I placed a restriction on shortcodes in version 2.5 so that they would only work on single post pages because I had learned that they caused performance issues on some multi-post pages. I have just released a new version (2.6) with three new shortcodes that will work on multi post pages the shortcodes are SIM-BY-TAG-MULTI, SIM-BY-CAT-MULTI, and SIM-BY-MIX-MULTI. If they were working for you just change to the multi version of your shortcode.
Dear David,
You are certainly amazing. Such a swift reply, and such a professional response to my question!
Thank you very much!
Angie
Unfortunately…
It still doesn’t work on my multi post pages 🙁
I’m using your shortcode [SIM-BY-MIX-MULTI]
The former version (2.4?) gave no performance problems on my site.
Do you have any suggestions I might try?
Should I go back to 2.4? – If so where can I find that?
Tnx in advance,
Angie
The version that was working for you is version 2.3 (I skipped version 2.4) – you can download that version here. My first suggestion would be to try that version again and prove that it is still working. My other suggestion would be to tell me where in your code you are using the shortcode so that I might be able to identify a reason it would not be working.
The 2.3 version works fine for me.
I use the shortcode at the end of the posts, but have tried various positions with the 2.6 version…
Is there a way to make the similar post links appear at the end of the post instead of the beginning?
Thank you for all your trouble, I really appreciate it.
Angie
I’m glad that 2.3 is working for you. I’ll have to dig into my code and see if there are any differences between 2.3 and 2.5 that I had forgotten about.
Do you know of a way to make the similar post links appear at the end of the post instead of at the beginning?
Because of the way WordPress processes shortcodes they always appear at the beginning of the post or the widget where they are located. To have your list appear at the end of your post you have two options – you can use the auto-display option or else you can modify your templates with the php function call. The auto-display option only works on single post pages right now and is not available prior to version 2.5 but if you wish to use the php calls and need help I would be more than happy to assist. It’s pretty simple.
David, tried using the auto-display option but it doesn’t show any output at all. Works with other options and shows the posts at the beginning of single posts but I want it to show either in the end or in the middle of the posts.
am using the latest wp version.
Is it something I am missing?
Which auto-display option are you using (so that I can take a closer look)? Also, I looked at your site and I can’t tell if you are using any tags (they aren’t displayed where I can see them so I can’t tell).
You are right David, I should make the php calls in the coding of my site’s templates. I did, and it works fine now with 2.6 – Thanks again!
I’m glad it’s working for you. Happy blogging.
Hi David,
Thanks for the great plugin.
Unfortunately, it displays related links at the top of my posts and I want them at the bottom.
Is that possible and how?
Thank you
To have full control over the display you can use the php calls by altering your template. I am working on a way to have the automatic display functions display at the bottom of the post more consistently.
Unfortunately I don’t know good php well enough to change the code. If you manage to put links at the bottom, please let me know when the updated version is ready.
Thank you
Yes, there’s little use making an auto-display function specifically so that people won’t have to alter their php if it doesn’t function the way that people expect. I finally found what was causing the trouble and have uploaded the new version. As of Similarity version 2.7 the list of similar posts shows at the bottom of the post.
Downloaded and installed.
Fantastic, it works!
Thanks a lot, David 🙂
David, is it possible, to make the auto-display function optionally working for “pages” too?
In the meantime, I’ve solved it with php-code in the footer of the pages.
That should be doable. I’ll see about getting that into the next version. Because pages cannot have tags assigned to them the only function I would make available would be the sim_by_cat function.
the auto-display function for “pages (with tags)†is working very fine and it is very clear in the options to activate it. Many thanks for your great work. The Lord Jesus bless you much!
Simple Tags gives the ability to stick tags on pages.
Good to know. I guess I should support the option.
Hi, I am using your plugin
I have tried to set it so that nothing shows up if there are no related posts. No matter what I enter into #Default display if no matches:# it seems to show ‘related Posts’ always
Can you advise?
Nick
What’s happening is that the #Text and codes before the list# always shows – like a list header. I can tell you how to fix it so that is not the case, but it brings up a question I have had in designing the plugin – Should #Default display if no matches:# stand in place of items in the list, or should it stand in place of the entire list? You can see that I chose the first option, but the more I think about it I think it would be easier to support the second option. What do you think?
I think the second option would make the plugin perfect!
I’ll make that change in the next version (which might be released later today).
Thanks a million for your prompt response and helpful email. If only all people were like that.
You’re quite welcome.
[…] Similarity, pour afficher les articles similaires, selon la catégorie ou les tags (ou les 2) […]
Hello Dave,
I have problems with the new function with the shortcode changes since version 2.5. Downloading v 2.3 gets no solution.
The problem: On my hompage (multiple articles) the top post should be the one for creating the similar articles in the sidebar. In the past, this works just fine, but for now, only the single post will display the correct similars. In the home view the output is like random.
I don’t use the dashboard. In the sidebar.php I’ve used the shortcode.
What can I do?
Thanks, JN
I’m not exactly sure what behavior to expect when you want to display a similarity list from a single post on a page that outputs multiple posts. That might explain why it appears to be random for your homepage. I’ll think about it and see if I have any ideas.
I’m sure that in the past the top entry outputs exatly the same list as in the post itself. isn’t it?
If you have posts that are equally similar in the list those posts will be displayed in a random order in the list.
Hello David,
I have tried to include shortcode in the sidebar text widget but sounds like it doesn’t work in 2.8 🙁
I’ll have a look and see what I need to do to have it start working in 2.8
Could you be more specific about which shortcode you are using? (I looked at your site and the similarity list seems to be showing up just fine below the posts on single post pages although I can’t tell if that is from a shortcode or some other method.)
On my site, I have used the php function call in my theme. I have tried few shortcodes in a sidebar text widget but none worked so I have removed these.
Thanks for the letting me know. I tried shortcodes in my sidebar (running on 2.8) and everything seems to work as expected. If you want to try shortcodes again you should be careful that you are using ALL CAPS in the shortcode and that you are using hyphens (ALL-CAPS) rather than underscores (ALL_CAPS) like you use in the PHP calls. Aside from those hints I can’t reproduce your issue – sorry.
Hallo David,
thanks for supporting. I use this shortcode:
This just works perfect on the single posts. In the past, I saw no difference between a single post and the top most of the home. But may be that I’m wrong. However it would be great if this could be an option.
The shortcode got removed in the comment – try not adding the brackets around it.
Well, I tried again following your rules with ALL CAPS. Doesn’t change 🙁
I have tried to debug a bit. If I put the shortcode in a post content, it works fine. But in a text widget, it doesn’t 🙁
Silly me – I forgot that there’s a trick to shortcodes working in sidebars. Some themes are not set up to accept them. If you are comfortable with editing your theme there is a simple fix detailed at WP Recipes. You have to add add_filter(‘widget_text’, ‘do_shortcode’); in the functions.php file for your theme. (I added it as the last line of code in my functions.php file.)
You are a king! Fixed the issue!
Now, I have another problem, the SIM-BY-MIX-MULTI doesn’t seem to work on multiple posts pages. One nice thing would be that on single post pages, it automatically use the single SIM version and on multiple page, the MULTI SIM version. On sidebar, you cannot add php code so you can’t filter to say on multiple post use this one and on single, that one…
Thanks!
Try the SIM-BY-MIX shortcode and see if that does what you want.
Yes it does. There is just a small bug but it may not be related to your plugin, I don’t know… The text of the similar posts is going into the previous widget within the sidebar instead of the one it is supposed to be into, really strange…
If you update to version 2.9 of Similarity there are new php functions for use in sidebars that show on multiple pages. These functions produce a Similarity list based on the top post of the multi-post page (rather than the bottom as was being displayed before).
Enjoy.
Thanks for the plugin.
A question: my front page is a “page”. I have the 2 most recent posts in my base (Aktuell) category always displaying there. I’d like a list generated with Similarity, below the 2 post extracts, but EXCLUDING the 2 posts already displayed.
I have implemented it on the website above. Perhaps you could check it out.
Is there any way I can do this? (I am still using 2.7.1)
Thanks
Peter
The way you are currently using it will display a similarity list based on one of those two posts and it will exclude the post that is used to generate the list. The plugin does not have an option to exclude other posts on the page.
Hi david,
I have a little problem installing the plugin. I have activated it in my wordpress blog but its not showing in the posts. I have a hosted service and wordpress2.8 installed on my home folder
Could you tell me a little bit more about the settings you have for the plugin? For example, have you added the php calls to your template, or added shortcodes anywhere to display the list? Are you relying on the automatic list, and if so what settings do you have on the “Auto-display list from function”, “Number of posts to show”, and “Minimum match strength” fields of the Similarity Options page?
Hi David, I just translated Similarity to German. How can I give it to you for integration?
Nice Weekend
Bjoern
[…] in WP über die Plugin-Verwaltung oder per Downbload bei: David Miller Diese Icons verlinken auf Bookmark Dienste bei denen Nutzer neue Inhalte finden und mit anderen […]
I’m using similarity 2.10 on a 2.8.4 worpdress blog, and I have 2 problems: if I ask it to add a random post at the end, it adds draft sometimes. And the second point, if there is no match, the content stay empty even if I put a default text in the page option.
I’ll have a look at the code, but it was supposed to exclude drafts from consideration.
I forgot, if you are logged in as an admin, or the author of a post you would be able to see it in the similarity list as if it were public – if you were not logged in it would not display drafts.
First of all: thank you for the plugin!
I’ve only one remark regarding it: i use similarity 2.10, and i notice that pending posts (ie: post_status=pending) are displayed in the related posts’ list (whether i’m logged in or not).
Best regards,
Julien
Good catch – I will fix that in version 2.12 – “pending” will be treated the same as “draft” (the post author will see it if they are logged in). I should have that released by tomorrow.
Nice plugin! This does exactly what I wanted….
My only concern: This plugin should have had separate styling available for sidebar one and the post one…
Good point. I can add that to the next release.
hello
thanks for this nice addon 🙂
i just want to say thanks 🙂
Why there is nothing displayed on my WP?
I already install the plug-in on http://blog.dannyskom.com/
My first guess would be that you need to go to the Similarity Options page and set the “Auto-display list from function:” setting to something besides “none.”
If you want more flexibility you can choose add a php function call anywhere in your template (assuming you are comfortable altering your theme templates), but the simplest way to get a list is to set that option and have lists automatically displayed at the end of your post on the single-post pages.
This is a great plugin, but I was wondering if it is possible to display the list of related posts alphabetically by title instead of by date published?
The list is not based on publication date – it is based the degree of relatedness – the posts at the top are the most closely related to the main post – equally related posts are in random order.
I suppose that it could be made to display the posts in alphabetical order but it is not currently designed to do that.
I have to say that this was a lucky day for me. I’ve been trying to get a related plugin that works for me for sometime.
Thanks a lot. Wondering though how to remove those 1.0 and 0.00 at the end of the links.
You have two options to remove those – you can edit your output template so that there is no reference to {strength} or else you can choose another option in the Display format for similarity strength. You apparently have it set to “Value” (the default) but you could choose “Percentage”, “Text”, or “Visual”. You can read the details for those options on the “Help and Instructions” page.
What’s the best way to put a title before the list (e.g., Related Posts) and also center the links on the page?
The best way to place a title before the list would be to place the title you want in the “Text and codes before the list:” field on the settings page.
As for centering the links – that’s a matter of placing the codes and/or styles for centering in your settings. If you want to center the whole list I would recommend putting the centering code in “Text and codes before the list:” (with any necessary ending tags in the “Text and codes after the list:” field). If you want to just center the links you might want to place the necessary code in the “Output template:” field.
Great plugin and it is so simple to use. I’m a coder myself and found it useful.
Thanks David — Lovely plug in and it is functioning well.
However, just a simple question,
Q: Is it possible to leave (ie: retain) the active page you are viewing — this dissapears from the list once you click on it.
I would prefer it stays visible and changes colour to indicate it is ‘what you are currently looking at?
Any help would be most appreciated.
PCE.
It would be possible. What’s happening is that when you click a link it opens the post for that link and then displays the similarity list for that link. (The similarity list for the new post will sometimes, but not always, include a link to the post you came from.) It would be easy enough to include the current post in the similarity list but I think what you are asking is for the similarity list of the post you came from to be displayed. I’m confident that this could be done, but it would take a fair bit of work to get there.
Thanks for the prompt reply David.
Ideally, it would be something like:
CATEGORY POSTINGS LIST
Post 1
Post 2
Post 3
Post 4
Then, when you click on ‘Post 3’ for example, it would take you to that page AND remain on the menu choices… Understand this would be complicated, but though there might be a quick hack to keep the ‘active page’s’ title within the list…
But, the effort you have gone to is fantastic nevertheless. Thanks again and good luck with the rest of your endeavors. Great Plugin.
I can’t think of a quick hack to do that but I’ll keep that in mind for future development.
Glad you like what I have done so far.
[…] Similarity – ????? ?????? ? ??????? ?????????? – ?????? ?? ?????? ??? ????????? […]
Hi,
The plugin look great, but I have one problem with it – it shows me also static pages while I want it to display only posts. Is there a way to limit it to posts only?
More than that, is there a way to exclude certain categories from plugin’s scanning?
Thanks,
The only way it should show pages is if you are using a plugin to add tags and/or categories to your pages. I could easily code Similarity to exclude those, but was not sure if it would make a difference. If you are interested in that change I can plan to include it in the next release. Excluding categories as likewise possible although I would have to make some decisions about how to handle that in the interface.
[…] 7. Similarity […]
[…] Similarity […]
Hi.. Great plugin!
Can you expand on what do to when wanting to remove the ratings at the end of links, including the eyelashes? You mentioned to remove the “strength” references in the output file. I removed all of them in similarity.php as well as others, it either didn’t work or broke the site, I just revered to the original code and started tinkering again so no worries!
Nice work BTW!
Also…. ONE MORE SORRY…. Is it possible to override posts so they absolutely will show up in specific category posts? Like, I want about 5 articles to show up in CATEGORY A’s Posts but only there! And then 5 Others in CATEGORY B’s Posts.. etc etc…
note that if there were two categories assigned, they’d both have to show up I’d imagine… Just a thought!
Any way to do it?
THANK YOU MUCH
You should not need to go into the code to remove the “strength” references – just change the output template in the Similarity settings page. If you have a blank template the plugin defaults to “<li>{link} ({strength})</li>” If you like the format but want the strength to disappear just put “<li>{link}</li>” as the output template. (Removing all references to “strength” in the code would break some important parts of the plugin.)
As for your second question – I’m not completely clear on what you are asking, but it could possibly be done by some very intrusive tag manipulation – I certainly don’t have any built in way to create some sort of super-association.
David,
Your reply on removing the strength was excellent. Thank you! I’m so used to changing code I didn’t even think that “Output Setting” was on the actual admin screen! heh…
In regards to intrusive tag manipulation. Can you expand? And to clarify. I’m trying to have “Category A” show 5 specific related articles, while “Category B” through Z show their own 5 specific related articles. They would be “constants” instead of dynamic!
Thank you VERY much,
Rocky
David,
One more BIG question for you! And thank you again. Your work on this plugin is GRADE A. Is it possible to put the related links in the sidebar? If so, how? I’d imagine a line of code in the template would do it. Maybe working though another pluging that allows code in the sidebar! Which I do already have one installed!
Thank you,
Rocky
Upon further consideration the intrusive tag manipulation I hinted at would not work – the algorithm is specifically designed in a way that would not make that possible. I have some other ideas about how that could be accomplished through category templates – but that’s a completely different topic that has nothing to do with this plugin.
As for putting the links in the sidebar – yes, that can be done and I have built lots of options as to how to do it. The easiest if you are comfortable altering your templates (and I suspect you are) would be to add the php call “<?php sim_by_tag(); ?>” into the place on your sidebar where you want the list to show. (You can use sim_by_cat or sim_by_mix if you prefer.) If you want it to show up somewhere in the middle of a sidebar that uses widgets you would have to use one of the shortcodes ([SIM-BY-TAG] for example). If your plugin allows for php calls then you could just use that to insert the php calls where you want with that.
hi and thanks for the plug 🙂
I have a problem, I inserted this code in my pages.php file, it works when it has at least two relatives posts, but it doesn’t when it’s associated to only one post, why? should I change one parameter?
example where the code works : http://www.actu-rock.fr/artistes/peter-doherty-biographie/
and where it doesn’t work whereas it should : http://www.actu-rock.fr/artistes/jimi-hendrix-biographie/
In fact I realised that it didn’t take the last newsn only the olders one
I would be interested to know what you have set for “Minimum Match Strength” and it would help if you could explain what posts should be related to http://www.actu-rock.fr/artistes/jimi-hendrix-biographie/ and how they should be connected.
the number is 0. Normally it should relate all the posts from here http://www.actu-rock.fr/tag/jimi-hendrix/ except the page
thanks for helping
Is one of those a page rather than a post? If so, do you have “Display Similarity on Pages” set to “Yes”?
Here you have two results for the tag jimi hendrix http://www.actu-rock.fr/tag/jimi-hendrix/ first one is a page, the second one is a post, I only want to relate the post with the page, both of them have the tag jimi hendrix as attribute.
Yes I set to “yes” the “display similiraty on pages”, but even if it’s no or yes, it doesn’t change anything
Had “Display Similarity on Pages” been set to “No” it would have excluded the page and explained the lack of results – as it is, I will have to dig a little deeper to explain this behavior and solve the issue. Thanks for your patience and assistance.
Ok I’ll wait, thanks for your help
The display format for similarity strength in the percentage format does
not work in my Blog (http://katja.at/start). Only the “decimal format” appears, though I made the correct settings. Formerly it worked and I don’t know by which version this function get lost.
Thanks for alerting me – I’ll look into that.
Repeating my Post from December 29, 2009 at 3:11 am:
The display format for similarity strength in the percentage format does
not work in my Blog (http://katja.at/start). Only the “decimal format†appears, though I made the correct settings. Formerly it worked and I don’t know by which version this function get lost.
I’m sorry Gerhard, I should have gotten back to you on that sooner. I’m using Version 2.13.2 of the plugin on WP 2.9.1 and the strength in percentage is working just fine. That code has not changed since I first implemented it. Try displaying strength as “Text” or “Visual” – if everything but percentage works then my best guess would be that another plugin or possibly your server or browser is taking the “%” as a special character and causing that display format to fail. If that’s the case we could write out “percent” if you are interested.
After many updates in the meanwhile (all last versions), the percentage format doesn’t work yet. The other formats aren’t working too. by all settings always the decimal format (0.873) will be displayed. So I assume, that a new format (write out) “percent†won’t work too. Do you have another idea, where I could join on?
I have been unable to duplicate your problem. I use the percentage format and it is working just fine. I’m not sure what might be interfering on your site.
The problem I have described above does still exist with Version 2.13.2.
Now I tried to go back to Similarity Version 2.12. on WordPress 3.3.1. and the strength in percentage is working again. The misfunction in 2.13.2. is reproducible with all the same settings.
So my problem might be caused in some code-difference between your last versions.
Per mail I will send you the printscreen of my settings.
Do you have any idea?
Thank you,
Gerhard
I do not know what the problem is but this time I am able to reproduce it. I will look into this and release a new version once I figure out the solution.
Thanks for bringing it to my attention.
[…] Similarity – ????? ?????? ? ??????? ?????????? – ?????? ?? ?????? ??? ????????? […]
I’m sure I’ve done something wrong, but I can’t get any similar posts to show up — all my posts are unique…
My first guess would be that you have set your minimum match strength too high on the Similarity Options page. Try setting it to “0” for starters and see if that gets things showing up.
Beyond that I would have to know more about what your settings are to be more helpful.
Thanks for the reply, but it’s set to “0”.
Other settings:
Relative mixing weights: 1:1, no random post, no to auto-display list from function and don’t show Similarity on pages.
By the way, I realised my problem was a website and tag problem on my website, not about your plugin
I’m glad to hear it because I was stumped.
Thanks a lot for this plugin ! it works great !
Good job !
Hello,
it seems the plugin shows pages in relative posts in WP 3.0
See here by example: http://www.li-an.fr/wpplugins/plugins/wp-google-fonts/
The first relative link is the About page.
Thanks for letting me know. I have not had time to look at 3.0 yet but I’ll see what I can do about that.
The plugin was not displaying sub pages (only parent ones). WP 2.9
So I had to comment out this code (line 658) :
if ($wp_version > 2.5) {
$query .= ” and post_parent = 0″;
}
Hi David
Thanks for the great plugin, i am using on my site: http://www.socialmedianews.com.au
Cheers
David
Hi David
I suspect it is because of the 3.0 version that it is not working for me, but would appreciate your advice… It is not showing up for me (see here: http://themyndset.com/2010/07/how-naughty-are-you-volvo-takes-test-drive-downtown/ for example). Thanks, Minter
I have been successfully using Similarity on 3.0 and 3.0.1 so whatever is not working it’s not version 3.
Sorry I can’t be more helpful.
Hi! Congratulations, i use it on my website and must admit this plugin gives the best relevant similar post results. I would like to enhance it via php, is it possible to add featured image to each similar post link? Thanks in advance.
There is nothing currently to do post thumbnails although I’m sure it could be done. Unfortunately I don’t expect to have time to work on that myself in the near future.
If anyone else were to get that working before I do I would be happy to include it in a future release.
Thank you anyway David 😉 good luck
or need your help
plugin “similarity” template works with Valid tags: {link}, {strength}, {url}, {title}
as possible insert tags {content}
and Limit Text Length?
thanks
Cristian,
Thanks for the suggestion. I’ll have to think about that and see if it is feasible.
Hi, i’m Antonio and i’m from Italy. I like to know if it’s possible to limit text length of Link. I don’t know PHP, How can I truncate the link in PHP? Thanks Antonio
Can it be done? Yes. Is Similarity built to do it currently? No.
If you would like to edit the code yourself I could look at what changes you would have to make or if you can wait that sounds like a useful feature that I could push out in a new release in the near future.