I'm trying to add an options in my theme settings to set the background-color of my mobile-menu using Redux Framework. I used the color_rgba type so I can pick a color with opacity.
I see my background-color set on my menu with class 'mobile-menu', but only a HEX value.
Redux::setSection( $opt_name, array(
'title' => __( 'Mobile menu', 'redux-framework-demo' ),
'id' => 'header-mobile-menu',
'subsection' => true,
'fields' => array(
'id' => 'header-mobile-menu-background',
'type' => 'color_rgba',
'title' => __('Mobile menu background Color', 'redux-framework-demo'),
'subtitle' => __('Background color for mobile menu overlay', 'redux-framework-demo'),
'default' => array(
'color' => '#E2E2E2',
'alpha' => 1
),
'transparent' => false,
'output' => array(
'background-color' => '.mobile-menu',
),
),
) );
How can I make sure I get the rgba color instead of the HEX color?
I am not using output to generate my style as I am handling my styles in a separate PHP file. But I will show you how I have done it and hopefully it can help you.
I think it is also possibly because you are not using a default RGBA value in your setting.
Here is my Field Array:
in my seperate php file I am calling my option name like so:
Then I am checking if there is a value in my options and if there is, use it in my style like so:
As you can see I am calling the other array at the end like so [rgba]
MY guess would be to perhaps try my way or perhaps add an RGBA value in your default array like so:
I hope this helps in any way.