A Better Related Posts Plugin
There are many plugins that find related posts for WordPress, and I was happy to use one of them in the past. However, WordPress evolves. One of the biggest change was the addition of custom post types. They are very useful and I use them a lot for my own and for client sites. And this is where every related posts plugin I tested failed: They don't support custom post types.
While reviewing the code of several plugins I decided that the Right Thing would be to write a new plugin from scratch. And that's what I did. Key features:
- Depends on PHP5 and MySQL5
- Option to add related posts to the RSS feed
- You can theme the output as you like
- Use fulltext indexes for good performance
- Does caching through post meta, this means zero additional database queries
- Incremental scoring for sites with many posts
- Find related posts, pages and custom post types
- Use different configurations at the same time, useful for different post types
- Internationalized, OO, hopefully well documented and readable
- Score relationships by various MySQL relevance scores or term relationships
Use tags, categories or custom taxonomies
The readme.txt contains extensive documentation. It is possible to create completely custom views of related content, including post thumbnails, date, excerpts etc.
Downloads are available at WordPress.org.
WordPress plugin demos are disabled as I don't use WordPress on this site any more.
I've downloaded and activated this plugin but it's not showing up on my pages. Am I missing something??
Well I figured out how to make it on the post BUT it's showing 8 queries in 0.0966 seconds, current offset 0 after the words Related Content. How do I get rid of that and the numbers after the related post link??
You can turn this information off on the options page. It is only displayed to logged in admins, not all visitors.
i've activated this plugin on WPMU and i get error :
"There is no fulltext index for wp_1_posts.post_content"
"There is no fulltext index for wp_1_posts.post_title"
Am I missing something?
Which MySQL version are you running? The fulltext index should be created at plugin activation, and IIRC the plugin checks for the indexes every time you access the options page.
Oh, did you perform a network activation of the plugin? I guess that would trigger the error on all blogs but the one you activated the plugin on.
If you did a network-wide activation please try again with the current trunk version: http://wordpress.org/extend/plugins/better-related/download/ (trunk should appear in a few minutes)
thanks nicolas, I am very pleased and will patiently wait
Btw, there's something wrong with the plugin repository. If you download the 0.4 release you'll really get the 0.4.1.2 release, which hopefully fixes your problem.
I hope the repo will be fixed soon..
Just getting started with this plugin and I need to know what values the multiplier fields take? is it just 0/1 or up to where? Need a bit more info on this...
They are simply integers and there's no limit. Actually, I should probably make them floats...
ok, thx. just wondering as by default two fields had 1 the rest had 0... will experiment a bit... I guess everyone has figure out his own values depending on what he uses most, categories/tags/etc..
ok, now totally confused. I read above: The scoring methods... so it seems the multiplier fields are not used at the same time?
Where do I select a scoring method?
Each scoring method has it's own multiplier, that you can set on the options page. Setting it to 0 will disable that scoring method. Use the_related_analyze(); to analyze which scoring methods are relevant for you. Hide that from normal visitors on the frontend though, use current_user_can().
I really don't understand. what do you mean relevant? I think all are relevant I just need to assign them a particular score depending on how goo the results they yield are? So if a particular scoring method gives me good results I raise its score, right? maybe lower or disable those that don't give good results and be happy with the resulting mix?
btw. what are keywords? meta-keywords?
I seem to be having some problems with the automatic injection into pages. the pages where I have hte problem, all have some sort of shortcode, either gallery shortcodes or other ones in them... it works for pages without shortcodes though. And I know there is related content because I used he_related_analyze(); to check it out...
Please check the readme.txt. If things aren't clear there I will update the documentation.
I have never seen this problem.
Please disable or delete all plugins and switch to the default theme. The default theme in WordPress 3.0.x is Twenty Ten. After making these changes does the problem still occur?
If not, switch the plugins on one by one and tell me which one creates the problem, I'll have a look.
Ok, read the readme.txt. two questions remain:
`= How to evaluate different scoring methods =
Logged in admins can get the results of all scoring methods by using the template tag `` in the loop of their theme.`
I don't think they are different scoring methods rather a mix of different scoring methods, right? I mean only if I give one method a value and 0 to all others have I decided upon a single scoring method, right?
You say Local admins can get an overview of all scoring methods, what do other visitors see with the normal output? I think it is a mix of the multipliers I have set up in the back end, correct?
`Keywords to content and keywords to title do a fulltext search for a string that contains all terms a post has. If a post is in the category Fruits and tagged sweet a fulltext search for "Fruits sweet" will be performed.`
So keywords = tag in this case?
`Terms against taxonomies searches for posts that have the same terms as the current one.`Terms = tag in this case?
Sorry to be so insistent I jsut want to make sure I udnerstood it right :-)
Please re-read the readme.txt. The analyze template tag has nothing to do with the normal related posts display.
Yes, there are different scoring methods. I'm just releasing 4.2, please check the updated readme. The normal related posts list uses a mix (or not) of different scoring methods.
No, "Fruits sweet" does not only contain tags in this case. Please check the readme.
Tags are terms, categories are terms, any term in a custom taxonomy is a term.
Hello, I got 2 posts in the same category. On the newer post the older one is under "Related Posts". But on the older posts the newer one doesn't appear. How do I make this work?
Hi Patrick, you can lower the score necessary to display results or show more related posts. The relevance score varies, depending on which direction the relatedness tests are performed.
Thanks for your advice. Lowered it to about 35 and it works now. :)
Ok, great! I'm currently working on a new feature to set related posts manually as well. Hope to release it soon.
hey, I am very glad to have found your plugin. it looks awfully useful, especially given all the fine tuning between post content, title, category and such!
– my problem:
I have included "" in my sidebar. while the plugin shows "related" posts under the single post, it at the same time says "no related" in the sidebar...
... can you help? thanks!
PS: “” meaning the php-template-tag
Hello! I tried to install this plugin using WP Admin and through FTP too, but It keeps showing:
There is no fulltext index for wp_posts.post_content
There is no fulltext index for wp_posts.post_title
What can I do to fix it? Thanks!
Hi oliver, I assume you meant the_related() ? You can pass the post ID as first parameter in the sidebar, that should work.
Hi, I think this is a bug. I've just released 0.4.3 which should hopefully fix this problem. you need to deactivate the plugin and activate it again.
This plug-in looks great !
However I've got the same problem than ubas for my blog :
http://windows-mobile.fr
Could you help me please ?
Best regards
I've installed 0.4.3 (from scratch as I've just discovered your plug-in ;-) ) but I've got the same issue...
Which MySQL version are you running? It has to be 5 at least.
If you are on v5 try to run the command "CREATE FULLTEXT INDEX content_index ON wp_posts (post_content);" in phpmyadmin or another mysql client. Do you get an error, if yes which?
Yes it's version 5.x :-)
I'll try to do as you tell me but to be honest I'never used any mysql client until now... :shame:
thanks for the feedback, Nicolas!
– but this hasn´t changed the display.
...at least if you were meaning taking out the »get_the_ID(),« line of the call-function. still I get the "no related" in the sidebar, though results are there with the same code-lines [including the ID call] in the body...
[on the sidetrack: still what the parameters of what I put in the sidebar actually do control is the display-behavior of the "automated display in post"-function if that setting is turned on... so there seems to be something going on in the background... :-}]
PS: … what actually happens when I take out the ID-line, is that the sidebar display switches to the heading filled-in in the custom-presets section of the plugin (even though automatic display for posts is turned off there)
Please keep in mind that I can't see your code, I don't really know what you are trying to do. It's probably filtered away because you used php tags.
http://codex.wordpress.org/Function_Reference/get_the_ID : This tag must be within The Loop.
thanks again! … I notice this bring me to the edge of my acpabilities, being a “user” rather than a “coder” :-}
what I put in the post (where it works) as well as in the sidebar is code (php-tag?) taken from your instructions. it is a
version of “the_related()”-function given there, to call up particular post-types:
that is:
[/php]
the_related(
get_the_ID(),
array(
‘usept’ => array(
‘references’ => true
),
‘do_c2c’ => 1,
‘do_t2c’ => 1,
‘do_k2c’ => 1,
‘do_t2t’ => 1,
‘do_k2t’ => 1,
‘do_x2x’ => 1,
‘minscore’ => 50,
‘maxresults’ => 5,
‘log’ => true,
‘loglevel’ => ‘taxquery’,
‘storage_id’ => ‘better-related-reference-’,
[... some more parameters unchanged from your example]
‘relatedtitle’ => ‘> associated references’,
‘relatednone’ => ‘no associated references’
)
);
[end php]
… so I guess, having “get_the_ID(),” in there, means “the tag is in the loop”?! or am I understanding things wrong?
Save the ID while you're in the loop and use it in the sidebar. Like $postid = get_the_ID() in the loop and use $postid in your the_related() call.
Hi Nicolas! I did the upgrade (deactivated and them the upgrade), but the error remains. I also tried the SQL do create the fulltext, but error again:
Query : CREATE FULLTEXT INDEX content_index ON wp_posts (post_content)
Error Code : 1214
The used table type doesn't support FULLTEXT indexes
What should a do now? Thanks
Ah, I see. Your MySQL tables aren't using the MyISAM storage. Are you the database admin? If yes, it might be possible to change the storage engine, see <a href="http://dev.mysql.com/doc/refman/5.1/en/alter-table.html" rel="nofollow">this page</a>.
MyISAM is the default storage engine for MySQL. I guess I could build engine detection into the plugin and create new tables if necessary... but this would create quite some overhead. I'll look into this for the next release, but at the moment I think it's rather unlikely I will add such a feature.
I did the change, now It's MyISAM and the error n plugin's page disappeared, but all posts from my custom post_type "Eventos" keeps showing "No related content found."
I'm using almost all the default configuration values, look: http://awesomescreenshot.com/09f3ksl22
You could try to reduce the score necessary to display results. There's also the analyze template tag. Custom post types can have a much lower score than normal posts, depending on how they were coded. You could also switch to the transients storage engine just to test various settings.
excellent plugin.
however, how do i stop the current article being the first related post? i don't want users going round an endless loop.
my current article always has a score of around 51000, and is always displayed as the first related post. all following articles are between 125 and 50 (my min score setting).
i would like to list "other" related pages, and not say "you might like to read the article you're already reading. it's relevelant!" ;)
thanks for your help.
Hmmmm, that's odd. How is the list generated on your site? Do you just use the built-in auto-add feature? This shouldn't be happening.
hello nicolas. thanks for the super quick response. i'm hard coding into my single.php (if that's what you mean). i’m using the_related() and it’s inside the loop.
That shouldn't be happening. Did you maybe install an early version of the plugin? The SQL queries exclude the current post by now, but I'm not sure if I added that before the first release. You can simply change one of the multipliers in the scoring options, save, and change it back. That will clear the score cache.
Actually, did you maybe edit the post after publishing it? I guess there could be a bug if I didn't verify the post status/revision or somesuch.
i'm using wp 3.0.1 and used the "add new plugin" function to install your related content version 0.4.3
i tried changing the multipliers. no luck. i did not edit the post after publishing. all current pages list themselves as the most relevant. sometimes ONLY listing themselves.
Hey dave, I'm just uploading 0.4.3.2. This was a serious bug that didn't only affect pages. It is fixed now, thank you for reporting the problem!
Tag to Taxonomy Multiplicator okay, but why not Category to Taxonomy Multi? If I got two posts with the tag "action" then they are linked. Fine. But if I got two posts of the same category (some posts have more than one cat, dont know if thats a problem) then they should also appear. They do not. Only if I go down to 10 % match and then it shows too much stuff.
Yes, there's room for improvement for the term to term relationship scoring. I plan to work on that for the 0.5 release.
It's "Term to taxonomy multiplier" btw, and should probably be called "Term to term multiplier", so it applies to tags, categories and any custom taxonomies.
Personally, I don't think that just sharing a category should make a post related automatically, but that's what the Term to tax multiplier is for, you can set it to something higher.
hi nicolas. i've upgraded the plugin to 4.3.3, but now i get no related content at all.
all my content is in pages. 'find post types' is set to page, the multipliers are set as default, no taxonimies ticked, and i've lowered minimum related score to 10.
oops. all my content is in posts. 'find post types' set to post. all other settings as above. now only listing current page, as before.
Could you give an example of your manual inclusion code that defines a specified custom post type and custom taxonomy please?
For the life of me I can't figure out how to modify the manual inclusion code to specify the custom post type and custom taxonomy that it should use.
The section "How to use different configurations at the same time" in the readme is all you need. The plugin will use the custom taxonomy your post type uses anyway. The usetax parameter is only for searches across different taxonomies, I assume you don't need that?
Hi Nicolas. I've implemented your great plugin, but in the results i see private declared articles too. Thats realy not good. Ok, the articles are not accessible for the users without the rights, but i do not want, that the headers are showed in my public area.
how i can prevent this? Is a secret option available for this?
best regards
Michael
Hi Michael. No, this is not configurable at the moment, but I will add this feature in the next release.
If you're comfortable with PHP you could edit lines 300 and 463 in inc/scorer.php to exclude them from the SQL query as a quick fix.
Hi Nicolas,
I have a quick question that your plugin may cure but I'm not sure, I was hoping you could give me some insight.
On this page http://waterworks-lamson.com/authorized/ I have an "authorized dealer" search plugin set up that when you type the state in the search box "california" it will return the results (post)california then you have to click on that to get to the post.
I would like to bypass the results page that you need to click on and go directly to the post. Is this possible?
And..... I would like to only have the search on this (page).
I hope you can help.... boy do I need it!
Thank you for your time!
Brent
Hello Nicolas,
I am trying to display custom post type thumbnails, but I can't get this to work.
Could you tell me how to re-write frontend.php (L. 480...) to display my custom post type thumb?
I call my thumbs like this:
cp_get_image($post->ID, 'ad-thumb', 1);
I would really appreciate the help... I just can't get it to work :-(
Thanks,
C.
Well, I think that should be possible, but it depends a little on how your site was coded. I assume you had somebody build it for you, you could just ask that person to look into this or you can use my contact form if you're interested in hiring me :-)
Hi, did you have a look at the readme.txt? It has examples for custom loops. cp_get_image() doesn't seem to be a wp function btw.
Hello,
Yes I looked at your read me file but I can't get your example to work with custom post type images, which is the whole point of using your plugin versus YARP.
cp_get_image() is a custom function that works when I need to display thumbnails in the sidebar or anywhere in the posts so I know that it can be called. I'm just really fuzzy about this whole custom post system so I would appreciate the guidance.
I'm sure many more people will be interested in knowing how to do this over time ;-)
Thanks for understanding,
C.
Custom post types aren't different from normal posts in regard to thumbnails.
The "How to build a custom loop of related posts" in the readme.txt features post thumbnails. Maybe I can help more if you ask a more specific question.
Oh, and you should not hack the plugin files btw, everything can be done in a custom loop. If you find any limitation let me know and I'll see what I can do.
Hi Nicolas, I manage a site with about 3000 posts: http://personensuchpool.de but no related posts will be shown. All your requirements are fulfilled: php5, mysql5. I deactivated other plugins but nothing and there are a lot of related ones. What do I wrong.
Thank you
Dietrich
Sorry, dämlichen Fehler gemacht, 2 Plugins verwechselt. Nun muss ich nur noch anpassen. Klasse Plugin, danke
Dietrich
Thanks Nicolas. I tried the code you mentioned (below) and it works. But it's not a loop, so I can't add thumbnails to my related recipes. Is there a way with this plugin to make a custom loop that <a href="http://codex.wordpress.org/Custom_Post_Types#Querying_by_post_type" rel="nofollow">queries a custom post type?</a>
'if ( function_exists( 'the_related' ) ) { the_related(
get_the_ID(),
array(
'usept' => array(
'recipe' => true
),
'storage_id' => 'better-related-recipe'
)
);
}'
:-D Kein Problem! Bitteschön!
Seriously? Did you miss the "How to build a custom loop of related posts" section? Just add your post type to $args.
That last sentence is what I needed. We're not all programmers. Of course I saw the section, hence my original question of how to define the custom post type to use. And the answer is to add your custom post type to $args. Thx.
Great :-)
Cool plugin! I set up a custom loop with thumbnails. Is there a way to show related items with thumbnails before those that don't have one? Or to show only related items that have thumbnails?
Yes sure, see http://codex.wordpress.org/Function_Reference/has_post_thumbnail for the latter. For the former you can store the posts with thumbnail in an external var or loop through your posts twice, see http://codex.wordpress.org/The_Loop
Thanks. For some reason I couldn't get has_post_thumbnail to work wherever I tried to integrate it (I must've not found the proper place to use it in my custom loop.) But I was able to get it to work by adding this to the array of argument:
''meta_key' => '_thumbnail_id','
From: http://wordpress.org/support/topic/display-the-post-only-if-thumbnail-is-set-up
Your other option sounds cool, but is way over my head. Just wanted to post this in case it helps others.
http://wordpress.org/support/topic/display-the-post-only-if-thumbnail-is-set-up#post-1769764
One last question, if you’d be so kind.
If, for instance, only 2 related posts are displayed with thumbnails, can a custom loop be set up to automatically display 3 random posts with thumbnails to fill out all 5 areas?
This may be a hard one.
This plugin doesn't show random posts. But you can probably just store the post IDs of the first loop and start a second loop that excludes those posts. See http://codex.wordpress.org/Function_Reference/query_posts for random order IIRC
I got it to work! Thought I'd share. I set up two loops, and somehow figured out how to set up a counter, so that the second loop returns only enough thumbnails to fill in 5 total thumbnails in case fewer than 5 related items exist. This way there are always 5 thumbnails and it looks great. It's only missing one thing, an argument to exclude the current post itself on which these are displayed from being returned as a thumbnail. But I tried everything and haven't found an argument that works. But it's still pretty darn well. Works for me. Thought it might help others and wanted to share.
<strong>Edit</strong> Sorry, I had to remove your code. WordPress is really lousy when it comes to code in comments. Can you pastebin your code? I'll be able to have a look then.
http://pastebin.com/kMc78FEj
Give this link a try. My code looks a little messy, so if you see a way to improve upon it, like excluding the current post, I'd love to hear.
BTW, when I turn on WordPress' debug in wp-config, my code gives this notice:
Notice: Undefined variable: do_not_duplicate
The code obviously works. So it's not a big deal. But should I just set the variable equal to zero right before using it, so it's defined?
Well, notices aren't so bad. Just define the variable before trying to access it. Like, $foo = array() etc.
Hi, I have using your the plguin. but it is show some wrong in admin panel. I am using mysql 5.1.54 and your plguin v0.4.3.3.
"There is no fulltext index for wp_posts.post_content
There is no fulltext index for wp_posts.post_title"
Your database probably doesn't use the MyISAM engine, which is the default for mysql. You should probably talk to your admin/hosting provider. This plugin will only support databases that support fulltext indexes.
See the comments by Leonardo for how to test which MySQL engine you're using.
I just see that InnoDB has been made the default with MySQL 5.5.
You could <a href="http://dev.mysql.com/tech-resources/articles/storage-engine/part_1.html" rel="nofollow">change the engine for wp_posts</a>.
I guess I could easily attempt to change the storage engine of the relevant table after asking for user permission. I'll be include such a feature in the next release.
I think should use InnoDB,so mysql offical choose. we have to use InnoDB. I have plan update to mysql v5.5. I have try mysql5.1 to5.5. but it is has some issue.
I'll have to look into the reasons why MySQL decided to use InnoDB by default. If you can't switch the content table to MyISAM this plugin isn't for you, at least not at the moment. This plugin uses fulltext indexes for the search, which InnoDB doesn't have. I'll keep an eye on the future development.
By the way, MySQL changing the default storage engine will only affect new databases, not existing ones.
I remember mysql offical said will give up MyISAM. This is a long time ago what they have decided. So I am use InnoDB. though I like the MyISAM easy backup.If I use MyISAM,then will not easy for mysql upgrade.
now your plguin work in my WP blog. but I do not know what effect that error.
thanks Nicolas for this plugin...
Currently I am using YARPP but I am planning to replace that with the plugin developed by you...i have one question though (a noob here)..I want to use a thumbnails in the related posts..can you guide/suggest me how to do that.
Thanks
Do you know how to build a normal loop with post thumbnails? Do you actually use the post thumbnail feature? If so, there is an example of a loop in the readme.txt iirc.
Hello Nicolas,
I'm having this problem with the plugin:
I'm trying to use the plugin to a post type called "Events", but it is showing only the posts of "events" are marked with the same taxonomy. I want him to show all posts "Events", regardless of their taxonomies. There's how to do this?
Thanks for the plugin.
Hug.
Did you check the analyze function yet? Maybe the contents of your events just aren't related enough? Also, the plugin only checks relatedness in the post_content field, not in any custom fields.
hi
1st of I have to thank u for the great plugin ! it's really useful ! I got question :
How can I insert it in my template and remove the automatic related links just after the post ? I wanna place it after the post block
Thanx
Check the options page, or the readme.txt.
Hi nicolas,
your plugin is nice, but after I installed for about two weeks, I can't display my preview post, even single post I.
the error massage:
Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in .../public_html/wp-content/plugins/better-related/inc/scorer.php on line 382
now I'm deactivating the plugin and waiting your advice.
thanks
Hi,
you'll have a hard time trying to get any plugins to work with 32MB. You should probably look into getting a better hosting package with more RAM.
You could try to reduce the query limit and to activate incremental scoring.
Hi, there is a problem with the admin backend: it doesn't seem to escape the values it tries to insert into the form.
Try using
<strong style="color:red">Related Posts</strong>
in the title field. The value is saved correctly but when the form shows up again its broken.
Exactly the same experience. PHP allowed size is same as above. Every othee plugin works like a charm. I tried to lower query limits. It allowed me to lower them to 100 (Query limit) and 200 (Total Query limit) , I also activated incremental scoring. But doesn't work. Failed to show the page at all. It started when the number of posts raised. There are currently about 8000 posts in the blog. Any suggestion ?
Thanks for reporting this, I'll look into it ASAP.
Well, I don't think this is something I can do much about. 32MB is really not enough to run many plugins. You could try the YARP plugin, maybe that works.
Hi Nicolas,
I just installed your plugin and was very impressed since it actually recognized the custom posts and ads through the admin settings panel in the classified theme that I'm using (ClassiPress from AppThemes), although when I test drive it on the front end, I always end up with "No related content found" despite checking all the custom fields in the settings and this theme explicitly uses the custom post types yet no results :(
post page ad_listing
category post_tag post_format ad_cat ad_tag
I'm on a dedicated server so no DB issues, using WP 3.1 latest update and using ClassiPress theme. Admin preview: http://www. appthemes.com/demo/?theme=classipress-admin
Did you try the analyze tag yet? It's usage is described in the readme.txt.
No I haven't and I just realized that the plugin actually worked but only under the main Blog posts and not the custom posts and custom categories, I'll try the Analyze tag attempt and update you with the outcome.
Thanks Nicolas.
Hi Nicolas,
Do you know what this warning might mean in regards to the code listed below it?
Warning: array_keys() [function.array-keys]: The first argument should be an array
$posts = array_slice( array_keys( $scores ), 0, 5 ); // keep only the the five best results
Is this happening because no related items are found?
Hi, is it possible to use it with special post (post type). I'm using post type to differ products from regular blog both in front and back end.
Hi Nicolas, I've already read the readme.txt file and all comments above, but I've a doubt about using taxonomy.
Say I have 2 different posts types, A and B, and a custom hierarchical taxonomy named "type", defined on both. If I use a configuration like this:
http://w3b.pastebin.com/v0erkGFN
should I get a selection of related posts from A to B (and viceversa), only if they SHARE THE SAME TERMS under "type" taxonomy, ?
In other words, for a post in A (or B), can I get a list of related posts, but only selected among B (or A) posts classified with the same terms under the same taxonomy?
Thanks in advance, Daniele.
Yes, please check the readme.
Hm, I'm not sure right now, but I'll look into this.
Hi Daniele,
hm, I don't think so. It's been a while I've worked on this code but I don't think you can query only one post type.
What you could do is to filter by post type in the loop that displays the results though (I guess).
For the next major release I wanted to rewrite the taxonomy scoring anyway, so I'll look into this. Thanks for the idea.
Don't worry about this one. The error was only displayed when I had an issue with another plugin, but isn't showing anymore. In other words, it might be an issue, but it also might not be. But it isn't causing any problems on the site right now, and since I don't see the error on the front end anymore, I'm not worried about it. Thanks!
Ok, thank you for the update!
I can't activate che plugin. I'm using the WP 3.1 and the plugin Version 0.4.3.3. I also have Custom Post Type UI, Custom Field Template, Header and Footer and Tweet Import activate.
#######################
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /nfs/c01/h16/mnt/6224/domains/sodastudio.it/html/wp-content/plugins/better-related/better-related.php on line 44
I think you're using PHP4? The plugins needs PHP5.
You are right, I have php4.
Thank you.
hi nicolas - huge thanks for making a plugin that works with custom post types - quick question:
my client has 3 distinct areas on the site - 3 blogs if you like - I filter these using categories - trouble is i use the category 'featured' across all 3 areas so it is relating blog posts just because they share 'featured' category
is there any way I can say 'ignore the 'featured' category' when scoring?
many thanks again
Hi Dean, sure, it's documented in the readme.txt. There are various scoring options you can disable/enable.
You can do this for just one specific category? by category ID?
I thought you could only add/reduce weighting for all categories?
Oh yes, you're right. No, that's not directly possible. There's a filter called 'better-related-taxquery' though. But I can't really recall if this query runs for more scoring methods. And there's no context on the filter.
So with the filter it should be possible to exclude categories. If it helps you I could add context.
thanks for your replies
ideally I'd like it to ignore for example Category ID6 for scoring but not penalise any post if it has that category.
my test site is here if you want to see [edit: 404]
anything that is 'Featured' category is what gets sent to the slideshow - which build a 'false' relationship
"There is no fulltext index for wp_posts.post_content
There is no fulltext index for wp_posts.post_title"
How I can solve this error?
Greetings Nicolas!
This is a great plugin. I have read this thread carefully and verified, that I am running PHP5 with MySQL 5.0.32. All tables are MyISAM. The plugin is creating FULLTEXT indexes called post_content_index and post_title_index for the post_content and post_title fields. I have even dropped and created the indexes by hand and used the code you suggested above. I received no errors in that process. My host will not be updating our MySQL version (grid based) for several months so I am stuck with it for now.
Unfortunately, I still receive the below error. Do you have any other thoughts?
There is no fulltext index for wp_posts.post_content
There is no fulltext index for wp_posts.post_title
Thank you very much!
Mike
Hm, that's odd. If the indexes exist maybe my code to detect them is buggy. Did you try to output related posts on the frontend? I'm not sure if the plugin would try to display them even without indexes detected.
What you can try is to add a <code>return true;</code> on line 223 of better-related.php to bypass the index detection. Please do tell me if the plugin works then, as that would be a rather annoying bug :-|
Nicolas,
I was able to get this corrected. It was not a problem with you plugin but with my database. I asked my host to take a look at the MySQL server and they corrected or changed something. Thank you for your comments and a great plugin!
Mike
Glad to hear it works :-)
works fine, but I would like to use the custom code to display some metabox fields from a custom post type. Am I missing something? I'm not a coder, could you help me out a little bit? Thanks! Britt
An example of the page you'll find on http://karpet.ch/redesign/teppich/almaty/ I adjusted the code slightly, but even with the code from your readme.txt file, i got the same problem. Below the the «Diese Shyrdaks werden Ihnen auch gefallen» 6 related items should be listed within the slider. The weird thing is, that sometimes it works but most of the time i get the above mentionned error message. Thank you so much for your kind help. A donation for your superbe plugin will be for sure..! ;o) Regards from Switzerland, Benjamin
'; I don't know if this is the line I am looking for and if it is,I don't know where to insert it, what file should I edit. Hope you can help me with this little problem. You are a great talented person. Thanks.
Any ideas on what might be causing the problems? The particular post on which the problem occurs has some
returns nothing and
returns 'NULL'. Weird, it only happens when the post content has some embed codes...
to- to see the dots in front. Any ideas?
, but it just lists the content without putting the bullet. Any idea why it is doing that? http://www.partybuilders.com/ad-category/party-planners/ Thanks, John
Then deactivate the plugin and reactivate.