Пример #1
0
/**
 * Returning our Scripts
 *
 * @since   0.1
 *
 * @return  Array
 */
function cora_get_scripts()
{
    $suffix = cora_get_script_suffix();
    $asset_uri = get_template_directory_uri() . '/assets/js/';
    // getting the theme-data
    $theme_data = wp_get_theme();
    $version = $theme_data->Version;
    // $handle => array( 'src' => $src, 'deps' => $deps, 'version' => $version, 'in_footer' => $in_footer )
    $scripts = array();
    // adding the magnific-js
    $scripts['cora-2014'] = array('src' => $asset_uri . 'core' . $suffix . '.js', 'deps' => array('jquery', 'sly'), 'version' => $theme_data->version, 'in_footer' => TRUE);
    if (cora_is_category_root()) {
        $scripts['sly'] = array('src' => $asset_uri . 'sly' . $suffix . '.js', 'deps' => array('jquery'), 'version' => '1.2.3', 'in_footer' => TRUE);
    }
    return apply_filters('cora_get_scripts', $scripts);
}
Пример #2
0
/**
 * Returning our Theme-Styles
 *
 * @since   0.1
 *
 * @return  Array
 */
function cora_get_styles()
{
    $suffix = cora_get_script_suffix();
    // $handle => array( 'src' => $src, 'deps' => $deps, 'version' => $version, 'media' => $media )
    $styles = array();
    $asset_uri = get_template_directory_uri() . '/assets/css/';
    // getting the theme-data
    $theme_data = wp_get_theme();
    $version = $theme_data->Version;
    // adding the main-CSS
    $styles['cora-2014'] = array('src' => $asset_uri . 'style' . $suffix . '.css', 'deps' => NULL, 'version' => $version, 'media' => NULL);
    // adding our webfonts
    $query_args = array('family' => 'Source+Sans+Pro|Quicksand');
    $styles['webfonts'] = array('src' => add_query_arg($query_args, "//fonts.googleapis.com/css"), 'deps' => array(), 'version' => NULL, 'media' => NULL);
    if ($GLOBALS['pagenow'] === 'wp-login.php') {
        $styles['cora-login'] = array('src' => $asset_uri . 'login' . $suffix . '.css', 'deps' => NULL, 'version' => $version, 'media' => NULL);
    }
    return apply_filters('cora_get_styles', $styles);
}