function list_all_categories()
 {
     if (is_main_query() and get_query_var("chronosly_category") != "") {
         wp_register_style('chronosly-front-css' . CHRONOSLY_VERSION, CHRONOSLY_URL . '/css/front_template.css');
         wp_enqueue_style('chronosly-front-css' . CHRONOSLY_VERSION);
         if (file_exists(CHRONOSLY_PATH . DIRECTORY_SEPARATOR . "css" . DIRECTORY_SEPARATOR . "custom.css")) {
             wp_register_style('chronosly-custom-css', CHRONOSLY_URL . '/css/custom.css');
             wp_enqueue_style('chronosly-custom-css');
         }
         if (!$settings["chronosly-disable-gmap-js"]) {
             wp_register_script('chronosly-gmap', 'http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array('jquery'));
             wp_enqueue_script('chronosly-gmap');
         }
         wp_enqueue_script('jquery-ui-core');
         wp_enqueue_script('jquery-ui-datepicker');
         wp_enqueue_script('jquery-ui-tabs');
         wp_enqueue_script('jquery-ui-tooltip');
         wp_enqueue_script('jquery-ui-resizable');
         wp_enqueue_script('jquery-ui-draggable');
         wp_register_style('chronosly-icons', CHRONOSLY_URL . '/css/icons/styles.css');
         wp_enqueue_style('chronosly-icons');
         wp_register_style('chronosly-fa-icons', "http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css");
         wp_enqueue_style('chronosly-fa-icons');
         if (!is_admin() or stripos($_SERVER["REQUEST_URI"], "wp-admin") === FALSE) {
             wp_register_script('chronosly-front-js', CHRONOSLY_URL . '/js/front.js', array('jquery'));
             $translation_array = array("weburl" => get_site_url(), "calendarurl" => Post_Type_Chronosly_Calendar::get_permalink(), 'ajaxurl' => admin_url('admin-ajax.php'));
             wp_localize_script('chronosly-front-js', 'translated1', $translation_array);
             wp_enqueue_script('chronosly-front-js');
         }
         wp_register_style('chronosly-templates-base', CHRONOSLY_URL . '/css/templates_base.css');
         wp_enqueue_style('chronosly-templates-base');
         //templates and addons css
         do_action("chronosly_custom_frontend_css");
         $sets = unserialize(get_option("chronosly-settings"));
         if (isset($sets["chronosly-base-templates-id"]) and $sets["chronosly-base-templates-id"] != 0 and !$_REQUEST["js_render"]) {
             if (get_query_var("chronosly_category") == "list_all_cats") {
                 $_REQUEST["shortcode_categories"] = 1;
             } else {
                 $_REQUEST["shortcode_category"] = 1;
             }
             Post_Type_Chronosly::base_template_code("ch-category");
             //exit;
         } else {
             if (get_query_var("chronosly_category") == "list_all_cats") {
                 include CHRONOSLY_PATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . 'archive-category-chronosly.php';
             } else {
                 add_action('pre_get_posts', array("Post_Type_Chronosly", 'add_custom_post_vars'));
                 include CHRONOSLY_PATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . 'single-category-chronosly.php';
             }
             exit;
         }
     }
 }
 public function inicia_scripts()
 {
     wp_enqueue_media();
     wp_register_style('chronosly-custom_wp_admin_css', CHRONOSLY_URL . '/css/admin_template1.css', false, '1.0.0');
     wp_enqueue_style('chronosly-custom_wp_admin_css');
     $wpScripts = new WP_Scripts();
     // if(!$wpScripts->query('jquery','enqueued')){
     //     wp_register_script( 'chronosly-jquery', CHRONOSLY_URL.'/js/jquery.js');
     // }
     wp_register_script('chronosly-admin', CHRONOSLY_URL . '/js/admin.js', array('jquery'));
     wp_register_script('chronosly-front', CHRONOSLY_URL . '/js/front.js', array('jquery'));
     $translation_array = array("scrollOnOpen" => !$this->settings["disable_slide_on_show"], "weburl" => get_site_url(), "calendarurl" => Post_Type_Chronosly_Calendar::get_permalink(), 'ajaxurl' => admin_url('admin-ajax.php'));
     wp_localize_script('chronosly-front-js', 'translated1', $translation_array);
     if (!$this->settings["chronosly-disable-gmap-js"]) {
         wp_register_script('chronosly-gmap', 'http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array('jquery'));
         wp_enqueue_script('chronosly-gmap');
     }
     $translation_array = array("days" => __("days", "chronosly"), "weeks" => __("weeks", "chronosly"), "months" => __("months", "chronosly"), "year" => __("year", "chronosly"), "color_cancel" => __("Cancel", "chronosly"), "color_choose" => __("Choose", "chronosly"), "stop_prev" => __("Slower preview", "chronosly"), "start_prev" => __("Faster preview", "chronosly"), "overwritted" => __("overwritted", "chronosly"), "specify_name" => __("You have to specify a name or select a template to update", "chronosly"), "wrong_name" => __("The name have incorrect characters, only are alowed chars between a-z,A-Z,0-9 and - or _", "chronosly"), "succes" => __("Saved successfully", "chronosly"), "duplicate_succes" => __("Cloned successfully", "chronosly"), "save_url" => CHRONOSLY_URL . "ev-functions/save_template.php", "guardamos" => $this->settings["chronosly_template_default"], 'ajaxurl' => admin_url('admin-ajax.php'));
     wp_localize_script('chronosly-admin', 'translated1', $translation_array);
     // if(!$this->settings["jquery-admin-disable"]) wp_enqueue_script('chronosly-jquery');
     //load progress
     wp_register_script('chronosly-dateformat', CHRONOSLY_URL . '/js/dateFormat.js', array('jquery'));
     wp_enqueue_script('chronosly-dateformat');
     wp_register_script('chronosly-colorbox', CHRONOSLY_URL . '/js/colorbox/jquery.colorbox.js', array('jquery'));
     wp_enqueue_script('chronosly-colorbox');
     wp_register_style('chronosly-colorbox-css', CHRONOSLY_URL . '/js/colorbox/css/colorbox.css');
     wp_enqueue_style('chronosly-colorbox-css');
     wp_enqueue_script('chronosly-admin');
     if (!is_admin() or stripos($_SERVER["REQUEST_URI"], "wp-admin") === FALSE) {
         wp_enqueue_script('chronosly-front');
     }
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-ui-datepicker');
     wp_enqueue_script('jquery-ui-tabs');
     wp_enqueue_script('jquery-ui-tooltip');
     wp_enqueue_script('jquery-ui-resizable');
     wp_enqueue_script('jquery-ui-draggable');
     wp_register_style('chronosly-admin-jquery-ui-css', CHRONOSLY_URL . '/css/smoothness/jquery-ui-1.10.4.custom.css');
     wp_enqueue_style('chronosly-admin-jquery-ui-css');
     //colorpicker
     wp_register_script('chronosly-spectrum', CHRONOSLY_URL . '/js/spectrum/spectrum.js', array('jquery'));
     wp_enqueue_script('chronosly-spectrum');
     wp_register_style('chronosly-spectrum-css', CHRONOSLY_URL . '/js/spectrum/spectrum.css');
     wp_enqueue_style('chronosly-spectrum-css');
     wp_register_style('chronosly-templates-base', CHRONOSLY_URL . '/css/templates_base.css');
     wp_enqueue_style('chronosly-templates-base');
     wp_register_style('chronosly-icons', CHRONOSLY_URL . '/css/icons/styles.css');
     wp_enqueue_style('chronosly-icons');
     wp_register_style('chronosly-fa-icons', "http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css");
     wp_enqueue_style('chronosly-fa-icons');
     do_action("chronosly_custom_backend_css");
     //select efects
     /*wp_register_script( 'chronosly-selectizer', CHRONOSLY_URL.'/js/selectize/dist/js/standalone/selectize.js');
       wp_enqueue_script('chronosly-selectizer');
       wp_register_style( 'chronosly-selectizer-css', CHRONOSLY_URL.'/js/selectize/dist/css/selectize.bootstrap3.css');
       wp_enqueue_style('chronosly-selectizer-css');*/
     /*   wp_register_script( 'chronosly-select2', CHRONOSLY_URL.'/js/select2/select2.js');
                    wp_enqueue_script('chronosly-select2');
                    wp_register_style( 'chronosly-select2-css', CHRONOSLY_URL.'/js/select2/select2.css');
                    wp_enqueue_style('chronosly-select2-css');
        */
 }
}
$month = get_query_var("mo");
if (!$month and isset($_REQUEST["mo"])) {
    $month = $_REQUEST["mo"];
}
if ($month == "current") {
    $month = date("n");
}
$week = get_query_var("week");
if (!$week and isset($_REQUEST["week"])) {
    $week = $_REQUEST["week"];
}
if ($week == "current") {
    $week = date("W");
}
$calendar_url = Post_Type_Chronosly_Calendar::get_permalink();
if (stripos($calendar_url, "?") === FALSE) {
    $calendar_url1 = $calendar_url . "?";
} else {
    $calendar_url1 = $calendar_url . "&";
}
if (!$_REQUEST["js_render"] and !$_REQUEST["action"]) {
    if (!isset($_REQUEST["shortcode"]) or !$_REQUEST["shortcode"]) {
        get_header();
    }
    if (!isset($_REQUEST["shortcode"]) or !$_REQUEST["shortcode"]) {
        ?>
        <section id="primary" class="content-area">
        <div id="content" class="site-content" role="main">
    <?php 
    }