-
Notifications
You must be signed in to change notification settings - Fork 804
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
Top Posts & Pages widget: applies filter post type choice filter after calculating total posts to display #2369
Comments
One suggestion for this is to pull a higher number (whatever reasonable... 20, 50, etc), then filter them locally to return the specific number of posts or pages. |
Also noting that this would also be resolved by #2196, though my earlier suggestion would work depending on the timeline for the rewrite. |
Top Posts & Pages (JetPack) stopped working, I had 10 posts displaying yesterday, now it's only showing one. What can be wrong? |
@scriptgeni Can you please use Jetpack's Debugger module to send us some more information about your site?
Thanks! |
I recently fixed the issue #2196 mentioned above. I can tell you that in resolving that issue, it did not fix this issue. This is due to the way Top Posts are retrieved from the server. Issue 1: Issue 2: After looking through the public-api code, to fix the first issue would require a change to the select statement used to retrieve the list to something like |
Also reported here: |
Also reported here: |
Reported in 3165769-t |
I really appreciate all the work that this community is doing in order to improve the plugin, but I have a doubt: is this issue fixed? I am asking because as reading from here it should be fixed by the 4.4 version and now we're running the 5.1 but I still have the same problem. I still have to try the fix proposed by @t22james from this topic on, but before I do it I would like to understand a bit more what is going on. Can we help the team testing some code? Shall we use the solution already proposed? I am asking because I think this is a bug that needs to be fixed because otherwise, we as developers will have a problem working with this widget, especially if we have clients that need some sort of "top post by category". I already tried to load more posts and then filter them out, but it does not assure to have a fixed number of posts inside our list. Sometime the list could be even empty and it's difficult to understand how to run a check to hide the title widget if the list is empty. Thank you for your hard work and for the support as well. Talk you soon, |
No, this issue is still open, we don't have any perfect solution yet, so nothing for you to test either. We'll update this issue once we have some news! |
Yep, still an issue. If Jetpack an detect the number of public post types, then why not just collect a number of posts (per the widget) and multiply it by the available post types. So if I have posts, pages, and portfolios, and my widget is set to show the top 5, then it would collect 15 posts. |
Related: 7973-wpcom |
also reported here 1006113-zen |
Another report in #11235 (cc @bsugerman) |
This appears to be a variation of this bug: https://wordpress.org/support/topic/bug-popular-posts-and-pages-widget/ |
Thanks for your reply, let me check the code, i go try fix it and i say here. |
Another report here: |
Also reported by 2471335-zen |
This should be fixed as of #15109. |
The updated Top Posts & Pages widget from Jetpack 3.6 is applying the types choice after the total is collected, which in most cases results in a mismatch with the desired total. This is hard for me to explain with words, so how about an example? :)
http://macmanx.com/ has 1,276 Posts, with stats going back to the day Jetpack was first released, yet when I set my Top Posts & Pages widget to display my top 10 posts, it only displays 6. If I set it to display my top 10 posts and pages, it displays 10, and 4 of those are pages.
In the above example, rather than fetching my top 10 posts, the widget fetches my top 10 posts and pages, then filters out the 6 posts from that.
The text was updated successfully, but these errors were encountered: