• Hello everyone,

    I’m trying to build an automation that sets a color based on already existing color set in “Customization”.

    Is there a build-in WordPress function or a php function to get a css value and use it in code?

    Example
    echo get_css_value(accent_color); result “#453245”

Viewing 1 replies (of 1 total)
  • No, there is no such function. How could there be: PHP runs on the server side while CSS is used in the browser. I would recommend you to look for another way. If it’s about a property that is set in the customizer, it’s surely somewhere in the database and you can access it via PHP.

Viewing 1 replies (of 1 total)
  • The topic ‘Get css value with php’ is closed to new replies.