Show multiple option in URL with Redux framework in front end


I’m creating a WordPress theme in which I’m using the Redux Framework for creating the theme’s options page.

I want to show multiple blog layouts without creating custom WP templates. I saw in many themes the URL is something like


Now in the theme-option file i’ve got this one for the sidebar:

'id'       => 'sidebar_position',
'type'     => 'select',
'title'    => esc_html__( 'Blog sidebar', 'omio' ),
'options'  => array(
    'left' => esc_html__('Left', 'omio'),
    'right' => esc_html__('Right', 'omio'),
    'disable' => esc_html__('Disable', 'omio'),
'default'  => 'right' ),

Now in the functions.php i’ve made a GET request code but didn’t work.

$sidebar = isset( $_GET['sidebar_position'] ) ? $_GET['sidebar_position'] : 'right';

switch ( $sidebar ) {

case 'left':
set_theme_mod( 'sidebar_position', 'left' );

case 'disable':
set_theme_mod( 'sidebar_position', 'disable' );

set_theme_mod( 'sidebar_position', 'right' ); }

How to do it, please 🙂
for example when I put the sidebar at the left ( nothing happen, sidebar stay by default at the right

Halas 3 weeks 0 Answers 2 views 0

Leave an answer