Skip to content
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

sort by rating does not show posts without rating #38

Open
ghost opened this issue Mar 4, 2015 · 4 comments
Open

sort by rating does not show posts without rating #38

ghost opened this issue Mar 4, 2015 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 4, 2015

Hi Lester,

first off let me thank you for this great plugin - great work!

I am not sure whether I am posting correct here or not, whether this truly is an issue or not:

I am sorting my custom posts by their average rating (works like a charm; I use setting the meta_key attribute in $query) - however the result-list contains only those posts that actually have a rating.

There is a page which tries to change this (https://wordpress.org/support/topic/plugin-wp-postratings-wp_query-sorting-by-rating-not-showing-un-rated-posts) but that does not work in my hands.

So my question is: do you have any idea how to keep the sorting and also show the non-rated posts at the end of the list?

Many thanks in advance and kind regards,
Frank

@lesterchan
Copy link
Owner

I thought of it before, but I can't find a way around it because those posts are created before WP-PostRatings is being activated.

The only way I can think of is manually add those ratings in.

@ghost
Copy link
Author

ghost commented Mar 4, 2015

Thank you very much for your immediate reply! I will try that. Cheers! Frank

@lesterchan
Copy link
Owner

I will leave this bug open since it is a bug. Hope more people can chime in on a better way to fix it =)

@Aristotle22
Copy link

Just take a custom loop and LEFT JOIN wp_postmeta.

https://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants