function cjtheme_custom_sidebar_metabox(array $meta_boxes)
{
    global $wp_registered_sidebars;
    $default_post_types = array('post', 'page');
    $custom_post_types = cjtheme_item_vars('custom_post_types');
    if (!empty($custom_post_types)) {
        $custom_post_types = @array_keys($custom_post_types);
        if (is_array($custom_post_types)) {
            $show_metabox_on = array_merge($custom_post_types, $default_post_types);
        } else {
            $show_metabox_on = $default_post_types;
        }
    } else {
        $show_metabox_on = $default_post_types;
    }
    if (!empty($wp_registered_sidebars)) {
        foreach ($wp_registered_sidebars as $key => $ssidebar) {
            $sidebars[] = array('name' => $ssidebar['name'], 'value' => $ssidebar['name']);
        }
    }
    // Start with an underscore to hide fields from custom fields list
    $prefix = '_';
    $meta_boxes[] = array('id' => 'cjtheme_custom_sidebar_metabox', 'title' => __('Choose Sidebar', 'cjtheme'), 'pages' => $show_metabox_on, 'context' => 'side', 'priority' => 'default', 'show_names' => false, 'fields' => array(array('name' => 'Sidebar', 'desc' => '', 'id' => $prefix . 'custom_sidebar', 'type' => 'select', 'options' => $sidebars, 'std' => 'Blog Sidebar')));
    return $meta_boxes;
}
?>
"><?php 
_e('Backup &amp; Restore', 'cjtheme');
?>
</a></li>
					<li><a href="<?php 
echo cjtheme_callback_url('core_uninstall');
?>
"><?php 
_e('Uninstall', 'cjtheme');
?>
</a></li>
				</ul>
			</li>
			<?php 
$dropdown = cjtheme_item_vars('dropdown');
foreach ($dropdown as $key => $menu) {
    $li_id = $key;
    if (is_array($menu)) {
        $mname = ucwords(str_replace('_', ' ', $key));
        echo '<li id="' . $li_id . '" class="has-sub-menu"><a href="#" onclick="return false;" title="">' . __($mname, 'cjtheme') . ' <i class="margin-5-left fa fa-caret-down"></i></a>';
        echo '<ul>';
        foreach ($menu as $skey => $sub_menu) {
            echo '<li id="' . $li_id . '"><a href="' . cjtheme_callback_url($skey) . '" title="">' . __($sub_menu, 'cjtheme') . '</a></li>';
        }
        echo '</ul>';
        echo '</li>';
    } else {
        echo '<li id="' . $li_id . '"><a href="' . cjtheme_callback_url($key) . '" title="">' . __($menu, 'cjtheme') . '</a></li>';
    }
}
function cjtheme_load_iconset_css()
{
    $enable_fonts = @cjtheme_item_vars('load_extras');
    if (isset($enable_fonts['icomoon-icons']) && $enable_fonts['icomoon-icons'] == 1) {
        $icons_url = cjtheme_item_path('framework_url') . '/assets/helpers/icons/icomoon/all/';
        for ($i = 1; $i < 13; $i++) {
            echo '<link rel="stylesheet" id="cjtheme_iconset-' . $i . '"  href="' . $icons_url . 'ncicons-' . $i . '/style.css" type="text/css" media="all" />';
        }
    }
}
function cjtheme_setup()
{
    // Make theme available for translation.
    // Translations can be filed in the /languages/ directory.
    load_theme_textdomain('cjtheme', get_template_directory() . '/languages');
    // This theme styles the visual editor with editor-style.css to match the theme style.
    add_editor_style(get_template_directory_uri() . '/css/editor-styles.css');
    if (!isset($content_width)) {
        $content_width = 900;
    }
    // Add default posts and comments RSS feed links to head.
    add_theme_support('automatic-feed-links');
    // Add support for widgets inside the customizer
    add_theme_support('widget-customizer');
    // Add support for WooCommerce
    add_theme_support('woocommerce');
    /*
     * Let WordPress manage the document title.
     * By adding theme support, we declare that this theme does not use a
     * hard-coded <title> tag in the document head, and expect WordPress to
     * provide it for us.
     */
    add_theme_support('title-tag');
    /*
     * Switch default core markup for search form, comment form, and comments
     * to output valid HTML5.
     */
    add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
    // This theme supports a variety of post formats.
    add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'));
    register_nav_menus(cjtheme_item_vars('nav_menus'));
    // This theme uses a custom image size for featured images, displayed on "standard" posts.
    add_theme_support('post-thumbnails');
    // Add Thumbnail Theme Support
    add_image_size('large', 1200, '', true);
    // Large Thumbnail
    add_image_size('medium', 900, '', true);
    // Medium Thumbnail
    add_image_size('small', 300, '', true);
    // Small Thumbnail
    add_image_size('avatar', 125, 125);
    //add_image_size('custom-size', 700, 200, true); // Custom Thumbnail Size call using the_post_thumbnail('custom-size');
}