Order posts based on meta field
-
Hello,
Thank you for this great plugin. It’s a great helping hand.
Is it possible to custom order posts based on a custom meta field value, using your drag and drop interface?
These custom field values are spread all over different categories.
-
Is it possible to custom order posts based on a custom meta field value, using your drag and drop interface?
I don’t understand your question. This plugin allows you to do manual sorting. If you order based on a meta field value, then use the drag and drop interface to change that order, then you are not long preserving your meta-field value based order….
Sorry if I wasn’t clear. What I want is if I can have the option, instead of choosing a category to use the manual sort, to use a custom field to sort the posts that have this field’s value
well, you can do that with a custom WordPress query and order by meta_value, you don’t need a plugin to achieve this.
Thank you @aurovrata for your reply,
I know about custom queries. I have no issues displaying and ordering on the front end.
But I need the functionality of your plugin to let the user decide the order of the posts that have this meta field value and are on variable categories.nstead of choosing a category to use the manual sort, to use a custom field to sort the posts that have this field’s value
maybe I still don’t understand what you are trying to do. Instead of choosing posts in a term to manually sort, you want to choose posts that have a common meta field value and then manually sort them?
Let’s say we have four categories. Each post has a custom meta ‘colour’.
Displaying these posts based on their color value in the front end is easy with a custom meta query.
What I want to do is to use your plugin to let the editor to manually sort the posts of each meta value as he would with a certain category.
I know there is an option to enable on your plugin the ability to sort posts based on their tags. I’m asking if there is a way to sort them based on a meta field value.
I apologise if my description makes it sound more complicated than it actually is.What I want to do is to use your plugin to let the editor to manually sort the posts of each meta value as he would with a certain category.
Please bare with me…
so if you have 4 categories say: fruits, vegetables, legumes, pulses
and all posts in these categories have meta field colour.
You want your editor to select a category, say fruits, and then be able to manually sort only the colour=orange ones?
Currently this plugin allows you to select and sort all posts within a given term.
It also allows you to display extra information on the post cards which appear in the sorting grid. By default each card has the title and the thumbnail, but you could add the value of the meta field ‘colour’ to each card, so when the editor is sorting the posts, they are able to see the value of the meta field.
not sure if this helps.
You want your editor to select a category, say fruits, and then be able to manually sort only the colour=orange ones?
Close enough, because on the “Red” meta value there are entries that belong to more than one category.
I don’t want my editor to select a category. I want to select a meta field value (Green, Orange etc) and manually sort them, so they appear on this selected order on the front end as if they were categories. Categories don’t matter at all.
So instead of choosing a category, to be able to choose a meta value and sort manually.There is a workaround but i don’t want to use it. If I have a secondary category of Colour values then i can sort based on that category. But this isn’t good practice.
Thank you for your patience ??
-
This reply was modified 4 years, 7 months ago by
gasmas75.
Thank you for your patience
thank you too, now I understand more clearly.
Currently the plugin is not able to do this. You would need to …
There is a workaround but i don’t want to use it. If I have a secondary category of Colour values then i can sort based on that category.
… that is the only way to do it with this plugin.
However, the problem is an interesting one, and this is something I could enable for greater flexibility in a future version.
This plugin was original developed by @aurelien and he abandoned it. I adopted it as I was using for some project, and realised it would be improved. v2.0 was a total recoded version pf that original plugin in a way that makes it more flexible to integrate with existing WP core functionality.
In v3.0 (the next major update) I plan for more improvements and I think your idea of enabling manual sorting of posts based on other selection parameters is an interesting idea.
Thanks @aurovrata for your input. I’m happy I gave a good idea, hope its implemented someday.
Meanwhile I’ll work on a workaround.
Thank you!Meanwhile I’ll work on a workaround.
a good night sleep often brings new ideas! I realised you could use a non-hierarchical taxonomy (like tags) to implement the same.
Using the previous example, you have categories fruits, vegetables, legumes, pulses, and a tag each posts using a orange, gree, yellow…
You would have orange colour for some posts that are classified as fruits but also under vegetables, pulses….
You would then use the plugin to manually sort your tags instead of your categories.
Hi @aurovrata,
Thanks for your suggestion. Indeed this could work (and it does actually). But I already have developed a plugin that uses a dropdown menu of meta values and the editors are already using (and populated the database) with these values.
For the time being our editors are sorting the posts separately on each category. It’s pain but it works.Thank you for your efforts and hopefully v3.0 will have this feature.
All best,
Kostasok, no issues.
-
This reply was modified 4 years, 7 months ago by
- The topic ‘Order posts based on meta field’ is closed to new replies.