Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
Sash
ParticipantHi, Long
Thx for your answer. Would you be so nice and give me an code example of how I do it with the init hook or the get_option version ...
I'm still a little inexperienced with it... this would help me a lot.
Thx a lot.
Cheers,
SashSash
ParticipantHi, Long
Thx for your answer. Would you be so nice and give me an conde example of how I do it with the init hook or the get_option version ...
I'm still a little inexperienced with it... this would help me a lot.
Thx a lot.
Cheers,
SashSash
ParticipantLike this
September 14, 2021 at 9:39 PM in reply to: Metabox settings page / color picker / css variables / Oxygen #30756Sash
ParticipantSome Friends send me the code... The Problem is more, that Metabox works in a other way. Im new in the metabox community und buyed the Dev licence couple days ago. My Questions to you was, how we can do this with Metabox. Thx
add_action( 'wp_enqueue_scripts', 'custom_css' ); /** * Set custom CSS variables using values from ACF options page. */ function custom_css() { $primary_color = get_field( 'primary_color', 'option' ); $secondary_color = get_field( 'secondary_color', 'option' ); $light_gray = get_field( 'light_gray', 'option' ); $main_dark = get_field( 'main_dark', 'option' ); $custom_css = " :root { --primary-color: {$primary_color}; --secondary-color: {$secondary_color}; --light-gray: {$light_gray}; --main-dark: {$main_dark}; }"; wp_add_inline_style( 'oxygen', $custom_css ); } -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)