-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How does related stories at the bottom pull the automatic list? #111
Comments
I'm guessing it will have something to do with the innards of the Largo_Related class, but will have to take ~5m to look at the other posts to see where they intersect with this post's tags and categories
|
2009 has "social justice" and "protests" But there are 120 other posts in that category! http://sfpublicpress.flywheelsites.com/wp-admin/edit.php?category_name=social-justice |
A quick review of the terms assigned to this post:
When The function As a result, no posts are grabbed from "police brutality" or "police reform", the two posts from "protests" are added, then with one more post to grab Largo_Related grabs the next-earlier post from "protest", and then because it has three posts to equal the requested count of three, it's done. It never reads the category. But as far as I can tell, based on usort and ternary operator docs, this code is written to perform the opposite way of how it's behaving. return ( $a->count < $b->count ) ? -1 : 1; |
So this is what's actually happening: Given tags and counts
This usort sorting function will return So of course it's picking from the lower-count terms. This is a Largo bug! 🐛 |
To solve this problem, pick one or both of:
|
Final tag merge should resolve this - will check back. |
@benlk now that categories are assigned, can you take another look and see if this has improved? |
Ah, looks like #126 will need to happen first. |
The related stories on the post http://sfpublicpress.flywheelsites.com/black-lives-matter-marchers-block-traffic-in-golden-gate-bridge-protest/ are now all drawn from the "Social Justice" category, as it is the only category shared by those posts. |
Still seeing issues with older posts popping up here, even though there are newer ones in the category. @joshdarby can you take a look? |
@MirandaEcho I'm assuming that post also has the same sort of issue that the one @benlk worked on did. original post:
tags:
S.F. Needs to Shut Down Streets During Coronavirus Pandemic
tags:
AIDS Research Used to Battle COVID-19 at S.F. Lab
tags:
California drugmaker's HIV prevention pill sparks public health debate
tags:
|
Opinion has 2 posts, HIV & Aids has 9. Those are the lowest-count terms on the post, and so the related posts are drawn first from Opinion and then from HIV & AIDS. Yes, this is the same thing. |
@MirandaEcho Do we want to do the same fix for this article that @benlk did for the earlier one? |
This is another Largo bug, correct? |
@MirandaEcho Yes, the same one as before. |
I thought the other article was fixed by removing low-used tags? Is Opinion a tag? |
It's a low-use category. |
@MirandaEcho No, it's a category. The other was fixed by removing low count terms which can be a category or tag. |
The issue in WPBuddy/largo#1868 is not tags vs categories; it's that the Largo Related Posts widget draws from the lowest-count terms assigned to the post rather than the highest-count terms. |
Moving this to post-launch. They can manually update related posts for now if there's an issue like this. |
Example: http://sfpublicpress.flywheelsites.com/black-lives-matter-marchers-block-traffic-in-golden-gate-bridge-protest/
The third article shown there is very old. There are newer articles that have the same category, so why aren't those showing instead?
The text was updated successfully, but these errors were encountered: