Redux Framework little info?

Hi all,
I made my theme using undercore and redux,
What i want to do next, is to have 2 header options: default and transparent header , and will be other 2 later.

Using Redux, i made my options

array(
‘id’ => ‘header_layout’,
‘title’ => esc_html__(‘Layouts’, ‘ralux’),
‘subtitle’ => esc_html__(‘select a layout for header’, ‘ralux’),
‘default’ => ‘default’,
‘type’ => ‘image_select’,
‘options’ => array(
‘1’ => array(‘alt’ => 'Default ', ‘img’ => RALUX_IMG_URI . ‘/1column.png’),
‘2’ => array(‘alt’ => 'Transparent ', ‘img’ => RALUX_IMG_URI . ‘/2columns.png’),
),
‘default’ => ‘2’,
),

img 1 is default header and 2 is transparent
In created my folder headers and here i have 2files header/header-default.php and header-transparent.php

But i don’t know how i have to add in header.php to be ok, and also how to make conection from what i choose in panel option theme ?

I know how to connection colors, image,background, i made all this, but to make, when choose transparent, my site to have header transparent, i don’t understand what to do next.

Many thanks for your help.

Use get_template_part with a Variable in the 2nd argument to load a file which represents your chosen layout.

https://developer.wordpress.org/reference/functions/get_template_part/

1 Like

Thanks,
Can you tell me please, or make an example?
Where i need to add that text from link?

i header.php i added

<?php get_template_part('/headers/header', 'default');?>

and it loads the default header file,
but how can i make to be changed from panel option redux?
i add as i write at the first, but i don’t understand what i need to add to work that change,
Thanks

Also i tried this

<?php set_query_var( 'header_layout', $header_layout); get_template_part( '/headers/header', 'transparent' ); ?>

header_layout because in redux panel i have
array(
‘id’ => ‘header_layout’,
‘title’ => esc_html__(‘Layouts’, ‘ralux’),
‘subtitle’ => esc_html__(‘select a layout for header’, ‘ralux’),
‘default’ => ‘default’,
‘type’ => ‘image_select’,
‘options’ => array(
‘1’ => array(‘alt’ => 'Default ', ‘img’ => RALUX_IMG_URI . ‘/1column.png’),
‘2’ => array(‘alt’ => 'Transparent ', ‘img’ => RALUX_IMG_URI . ‘/2columns.png’),
),
‘default’ => ‘2’,
),

no one? :frowning:

Here’s an example for a file /inc/header-layout-standard.php

$layout = get_option( 'header_layout', 'standard' );
get_template_part( 'inc/header-layout', $layout );

Hi,
Thank you.
This I need to add to header.php?

And in my theme option if I have to choose from header 1 and header 2 maybe header 3 how this will work?

Or I need to add your text in every header from inc folder?

Now in reduc I have select option to choose header 1 or 2.

Someone can clear this?:frowning:
Thanks

in header folder i have both headers files and in header.php
header-layout-transparent and header-layout-default

<?php $layout = get_option( 'header_layout', 'transparent' ); get_template_part( 'headers/header-layout', $layout ); ?>

But from redux theme panel when i choose default, is not change.
Thanks

No info?