You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get the 'post_order' meta value from the taxonomy landing page and use that as an arg for the posts query. If there is no tax landing page, then it orders by date.
query for infinite posts in the series, using the sort order.
I mean, it's great at getting related posts, and it's actually pretty good about returning ones that are actually related. But it's also like a bulldozer: good for moving things around, but not good for moving furniture in your house to vacuum. Do we really need to query for infinite posts?
Posted because I'm getting PHP out of memory errors with a related_posts widget on Vagrant with NPQ.
The text was updated successfully, but these errors were encountered:
Yeah...i've been thinking about this recently too and talked with @rnagle a bit about it. I want to revisit how it's working and make sure the logic is correct. Then we definitely need to figure out how to cache things or do something the minimizes the impact of this thing because right now it's pretty ugly.
The "Related Posts" widget query queries for posts in a list of post IDs. That list of post IDs is created by
Largo_Related
.Largo_Related:
get_the_terms
, which does cache the post object.cftl-tax-landing
page. If there is:'post_order'
meta value from the taxonomy landing page and use that as an arg for the posts query. If there is no tax landing page, then it orders by date.If the series query returns fewer than the requested number of posts, it proceeds to query infinite posts for each category the post is in.
If there are still insufficient posts, it runs a query for recent posts by date, but fortunately not infinite posts. It only queries one more post than the number of posts needed.
In order to add posts to the list of post ids that have been returned, the recent posts method creates and advances over a Loop of the returned posts. This could probably be an array function instead of a Loop.
I mean, it's great at getting related posts, and it's actually pretty good about returning ones that are actually related. But it's also like a bulldozer: good for moving things around, but not good for moving furniture in your house to vacuum. Do we really need to query for infinite posts?
Posted because I'm getting PHP out of memory errors with a related_posts widget on Vagrant with NPQ.
The text was updated successfully, but these errors were encountered: