/** * Returning our Helsinki-Styles * * @return Array */ function helsinki_get_styles() { $suffix = helsinki_get_script_suffix(); $dir = helsinki_get_asset_directory_url('css'); $theme_data = wp_get_theme(); $version = $theme_data->Version; // $handle => array( 'src' => $src, 'deps' => $deps, 'version' => $version, 'media' => $media ) $styles = array(); // adding the main-CSS $styles['helsinki'] = array('src' => $dir . 'style' . $suffix . '.css', 'deps' => NULL, 'version' => $version, 'media' => NULL); // adding the media-CSS $styles['helsinki-media'] = array('src' => $dir . 'media' . $suffix . '.css', 'deps' => NULL, 'version' => $version, 'media' => NULL); // adding our webfonts $open_sans_query_args = array('family' => 'Open+Sans:400,300,700'); $styles['helsinki-webfont-open-sans'] = array('src' => add_query_arg($open_sans_query_args, '//fonts.googleapis.com/css'), 'deps' => array(), 'version' => $version, 'media' => NULL); $open_sans_condensed_query_args = array('family' => 'Open+Sans+Condensed:300,700'); $styles['helsinki-webfont-open-sans-condensed'] = array('src' => add_query_arg($open_sans_condensed_query_args, '//fonts.googleapis.com/css'), 'deps' => array(), 'version' => $version, 'media' => NULL); // adding the font-CSS $styles['helsinki-fonts'] = array('src' => $dir . 'fonts' . $suffix . '.css', 'deps' => NULL, 'version' => '4.0.3', 'media' => NULL); // adding the magnific css $styles['helsinki-magnific'] = array('src' => $dir . 'magnific' . $suffix . '.css', 'deps' => NULL, 'version' => '0.9.9', 'media' => NULL); // adding the offcanvas-CSS $styles['helsinki-offcanvas'] = array('src' => $dir . 'offcanvas' . $suffix . '.css', 'deps' => NULL, 'version' => $version, 'media' => NULL); // check if we have a custom css $custom_css = helsinki_get_custom_css_file_url(); if ($custom_css !== '') { global $pagenow; $styles['helsinki-custom-css'] = array('src' => $custom_css, 'deps' => array(), 'version' => time(), 'media' => NULL); } return apply_filters('helsinki_get_styles', $styles); }
/** * Returning our scripts * * @return array */ function helsinki_get_admin_scripts() { $scripts = array(); $suffix = helsinki_get_script_suffix(); // getting the theme-data $theme_data = wp_get_theme(); $version = $theme_data->Version; // adding the offcanvas js $scripts['jquery-admin'] = array('src' => helsinki_get_asset_directory_url('js') . 'admin' . $suffix . '.js', 'deps' => array('jquery'), 'version' => $version, 'in_footer' => TRUE); return apply_filters('helsinki_get_admin_scripts', $scripts); }
/** * Returning our Admin-Styles * * @return Array */ function helsinki_get_admin_styles() { $suffix = helsinki_get_script_suffix(); $theme_data = wp_get_theme(); $version = $theme_data->Version; $dir = helsinki_get_asset_directory_url('css'); // $handle => array( 'src' => $src, 'deps' => $deps, 'version' => $version, 'media' => $media ) $styles = array(); // adding the admin-CSS $styles['helsinki-admin'] = array('src' => $dir . 'admin' . $suffix . '.css', 'deps' => NULL, 'version' => $version, 'media' => NULL); return apply_filters('helsinki_get_admin_styles', $styles); }
/** * Returning our scripts * * @return array */ function helsinki_get_scripts() { $scripts = array(); $suffix = helsinki_get_script_suffix(); // getting the theme-data $theme_data = wp_get_theme(); $version = $theme_data->Version; // adding the html5shiv $scripts['html5shiv'] = array('src' => helsinki_get_asset_directory_url('js') . 'html5shiv' . $suffix . '.js', 'deps' => array(), 'version' => '2.6.2', 'in_footer' => FALSE); // adding the magnific-js $scripts['jquery-magnific'] = array('src' => helsinki_get_asset_directory_url('js') . 'jquery.magnific' . $suffix . '.js', 'deps' => array('jquery'), 'version' => '0.9.9', 'in_footer' => TRUE); // adding the gallery js $scripts['jquery-gallery'] = array('src' => helsinki_get_asset_directory_url('js') . 'gallery' . $suffix . '.js', 'deps' => array('jquery'), 'version' => $version, 'in_footer' => TRUE); // adding the offcanvas js $scripts['jquery-offcanvas'] = array('src' => helsinki_get_asset_directory_url('js') . 'offcanvas' . $suffix . '.js', 'deps' => array('jquery'), 'version' => $version, 'in_footer' => TRUE, 'localize' => array('helsinki_offcanvas_args' => helsinki_get_offcanvas_args())); return apply_filters('helsinki_get_scripts', $scripts); }
/** * Gets the CSS file generated by the customizer * * @return string the url to the css file */ function helsinki_get_custom_css_file_url() { // get directory $upload_dir = wp_upload_dir(); $upload_basedir = $upload_dir['baseurl']; $customize_file_dir = $upload_basedir . '/helsinki/'; if (!is_dir($customize_file_dir)) { mkdir($customize_file_dir); } // get suffix $suffix = helsinki_get_script_suffix(); // get file $file = $customize_file_dir . 'customize' . $suffix . '.css'; return $file; }