-
Notifications
You must be signed in to change notification settings - Fork 42
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
custom orderby meta wp_query "fix" #3
Comments
I am a bit skeptical about adding this, why not hook it to the publish post hook instead? |
Sorry, I wasn't clear enough. I didn't mean to get this into the plugin. I just posted this here for future reference if anyone had the same problem. This code is meant to run only once, then delete it. Could be made into a tiny plugin or as a setting in your plugin. PS: hooking it to the publish post hook doesn't add it to all posts that don't already have a meta_key |
Arh I see! Cool, let me apply a label to it and keep it open |
as I have the same problem, could we run that code during the activation of the plugin and then add the metadata for newer posts in the publish post hook? I'm a Wordpress beginner, but I think we would fix the problem one time for all. I consider this issue a bug, not a feature request. Btw, the code posted in the previous posts doesn't work. These lines
should be changed to
|
i create a pull request for that! #39 |
I post this here because I had issues with a custom loop ordered by views. It didn't show posts that didn't have the views meta_key.
Run this once in your functions.php and remove after.. or let it sit there but there really is no need for it.
This code adds a meta_key
views
if the post doesn't have one and fills the value with a0
.The text was updated successfully, but these errors were encountered: