By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!
elementor official

Question Global Colors Display Order

3

3quid

New Member
Anybody know of a way of re-ordering the list of global colours? As standard they display in order added. I would like to be able to sort them, at least alphabetically, if not in a custom order.
 
geoffrey.m.campbell@gmail

geoffrey.m.campbell@gmail

New Member
Looking for a way to do this too. Any luck?
 
P

pegues

New Member
This can be done from within the database. You will want to look for _elementor_page_settings inside the wp_postmeta table. The meta_value will be serialized data, so save a copy of the _elementor_page_settings data before making an edit.

In your data, say you have the following (the following is a snippet of the data in the _elementor_page_settings value):

{{i:0;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 2";s:5:"color";s:7:"#123456";} i:1;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 3";s:5:"color";s:7:"#123456";} i:2;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 1";s:5:"color";s:7:"#123456";} i:3;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 4";s:5:"color";s:7:"#123456";}}

What you'd like to do is move the following to the top of the list:

i:2;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 1";s:5:"color";s:7:"#123456";}

What you will do is moving it as shown below:

{{i:2;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 1";s:5:"color";s:7:"#123456";} i:0;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 2";s:5:"color";s:7:"#123456";} i:1;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 3";s:5:"color";s:7:"#123456";} i:3;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 4";s:5:"color";s:7:"#123456";}}

If you add your new update as it is above, you will break the majority of your list because the index is in the following order: 2,0,1,3. You still need to update the index value to be 0,1,2,3.
Look for i:N, where N is your numbering from 0 to the last number in your list. After changing the index for all colors in your list, you will have the following:

{{i:0;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 1";s:5:"color";s:7:"#123456";} i:1;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 2";s:5:"color";s:7:"#123456";} i:2;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 3";s:5:"color";s:7:"#123456";} i:3;a:3:{s:3:"_id";s:7:"de51da3";s:5:"title";s:6:"Blue 4";s:5:"color";s:7:"#123456";}}

You may have 5, or you may have 50 colors in your global colors list. You'll have to update that value for all color records. And make sure to not change the name of your color or any other value here. All serialized data in this list has a character counter associated with it. Only change the names from within Elementor's editor as it will handle the serialized data changes for you.
 
Last edited:

Latest posts

Latest Resources

Other Elementor Resources

elementor official
Top