Implement of Codestar Sorter Field

Include the code the code in the config file–

[php]
// Sorter
array(
‘id’ => ‘aitasi_sorted_section’,
‘type’ => ‘sorter’,
‘title’ => ‘Section Sorter’,
‘default’ => array(
‘enabled’ => array(
‘home’ => ‘Home’,
‘service’ => ‘Service ‘,
‘aboutus’ => ‘About Us’,
‘contact’ => ‘Contact’,
‘footer’ => ‘Footer’,
),
),
‘enabled_title’ => ‘Active Sections’,
‘disabled_title’ => ‘Deactive Sections’,
),

[/php]

Then include the code in your template.

[php]
$sorter_data = cs_get_option( ‘aitasi_sorted_section’ );

if ( ! empty ( $sorter_data ) ) {
$enabled = $sorter_data[‘enabled’];
//$disabled = $sorter_data[‘disabled’];
}
// debug
//var_dump( $sorter_data ); // you will see here how to return data.

if ( $enabled ): foreach ( $enabled as $key => $value ) {

switch ( $key ) {

case ‘home’:
include_once( ‘section-home.php’ );
break;
case ‘service’:
include_once( ‘section-service.php’ );
break;

case ‘aboutus’:
include_once( ‘section-aboutus.php’ );
break;
case ‘contact’:
include_once( ‘section-contact.php’ );
break;

case ‘footer’:
include_once( ‘section-footer.php’ );
break;

}

}

endif;
[/php]