Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Function to display hex codes of colors in the current Kadence color palette

Home / Forums / Kadence Theme / Function to display hex codes of colors in the current Kadence color palette

This topic is: Not Resolved
[Not Resolved]
Posted in: Kadence Theme
January 20, 2023 at 12:36 pm

I’m trying to write a shortcode function to get the colors from the current Kadence color palette, then display them. So far, I’ve tried using the wp_editor_color_palette filter, but that produces no results. The idea is to have a shortcode with an attribute that requests a specific color name (variable) from the palette. For example, the shortcode might look like this:

[kadence_color color="accent-1"]

So, essentially, I’d pull all the colors from the current palette and place them in variables within the function, then display the one that is called by the shortcode attribute.

FWIW, I even tried to see if CodeWP or ChatGPT could come up with something and they both failed after multiple attempts. 😉

  • The forum ‘Kadence Theme’ is closed to new topics and replies.