dimanche 27 novembre 2016

Redux select output

I m workin on admin panel with redux framework and I m trying to switch by three diffentes headers by a select input from the backend.

My options array

Redux::setSection($opt_name, array(
'title' => __('Header', 'redux-framework-demo'),
'id' => 'scegli_header',
'subsection' => true,
'fields' => array(
    array(
        'id' => 'header',
        'type' => 'select',
        'title' => __("Scegli il tuo header", 'redux-framework-demo'),
        'subtitle' => __("3 template diversi di header", 'redux-framework-demo'),
        'desc' => __('Basic media uploader with disabled URL input field.', 'redux-framework-demo'),
        //Must provide key => value pairs for multi checkbox options
        'options' => array(
            '1' => 'Hero header',
            '2' => 'Boxed header',
            '3' => 'Fluid header'
        ),
        'default'  => '2',

    ),
)));

Here my output

<?php


    if ($ascaro ['header'] = 1) {

        get_template_part('includes/header/hero-header');
    }
    elseif ($ascaro ['header'] = 2) {

        get_template_part('includes/header/boxed-header');
    } 

    else {

        get_template_part('includes/header/fluid-header');
    }
    ?>

what's wrong?

Aucun commentaire:

Enregistrer un commentaire