Showing Section On Different way

 

In theme-options.php–

array(
‘id’ => ‘portfolio_layout’,
‘label’ => ‘» Choose portfolio layout ꜜ’,
‘type’ => ‘radio-image’,
‘section’ => ‘portSel’,
‘choices’ => array(
array(
‘value’ => ‘playout1’,
‘label’ => ‘Two column layout showing’,
‘src’ => get_template_directory_uri().’/p-layout/1.jpg’,
),
array(
‘value’ => ‘playout2’,
‘label’ => ‘Three column layout showing’,
‘src’ => get_template_directory_uri().’/p-layout/2.jpg’,
),
array(
‘value’ => ‘playout3’,
‘label’ => ‘Four column layout showing’,
‘src’ => get_template_directory_uri().’/p-layout/3.jpg’,
),
)
),

In Front-end–

<?php
if( ot_get_option(‘portfolio_layout’) == ‘playout1’){
get_template_part(‘p-layout/playout1’);
}elseif( ot_get_option(‘portfolio_layout’) == ‘playout2’ ){
get_template_part(‘p-layout/playout2’);
}else{
get_template_part(‘p-layout/playout3’);
}
?>

In plaout1 —

<?php get_template_part(‘p-layout/template/p-heading’) ?>

<?php get_template_part(‘p-layout/template/p-2c’) ?>

Enable or Disable Section By Option Tree

in theme-options.php

array(
‘label’       => ‘Enable slider’,
‘id’          => ‘pp_slider_on’,
‘type’        => ‘select’,
‘desc’        => ‘Show slider on homepage’,
‘choices’     => array(
array(
‘label’       => ‘Yes’,
‘value’       => ‘yes’
),
array(
‘label’       => ‘No’,
‘value’       => ‘no’
)
),
‘std’         => ‘yes’,
‘rows’        => ”,
‘post_type’   => ”,
‘taxonomy’    => ”,
‘class’       => ”,
‘section’     => ‘homepage’
),

 

And in front-end add this —

<?php
$sliderstatus = ot_get_option( ‘pp_slider_on’ );
if($sliderstatus == ‘yes’) {
get_template_part(‘slider’);
}
?>