1

I have a list posts by tag, but the relation is not relevant because first look for the posts with the first tags stored alphabetically, and not the first main tag, that is to say for me the order of the tags are key because the first tag is the most relevant. So when saving everything, it is sorted alphabetically and this does not help me, any idea how to alter this?

screenshot

  • 1
    It may be easier to create your own custom taxonomy than try to alter Core alphabetization. – WebElaine Apr 16 at 21:18
  • 1
    Terms/Tags aren't ordered, any order you see in the editor is purely circumstantial, there is no order mechanism in the database for terms. If you want to give special meaning to a term, you need to do so explicitly, e.g. store the term ID of the significant term in post meta – Tom J Nowell Apr 16 at 21:18
2

Terms/Tags aren't ordered.

To help make the terms easier to read, the editor will list them alphabetically, but that isn't because they're ordered alphabetically in the database. It's because a piece of javascript sorted the terms in the UI control.

There is no order, only the order you give them. Fundamentally terms have no order. Any order you see in the editor is purely circumstantial, there is no order mechanism in the database for terms.

If you want to give special meaning to a term, you need to do so explicitly, e.g. store the term ID of the significant term in post meta. You cannot rely on order, as terms do not have order.

| improve this answer | |
  • Exactly, I think that this is not going to be able to at all from the CORE, because what wordpress does is that if a tag exists it is simply the same id in the relation of increased term the counter, and if it is a new tag then insert a new one tag with new id, but the order does not exist in itself. I cannot order by ID because I know that the last one is not always the one that I put as the first tag in the editor. I have to create a separate custom field to be able to make that possibility, thank you very much for the reply. – Lenin Zapata Apr 16 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.