コード例 #1
0
ファイル: helper.php プロジェクト: WPDevHQ/nevertheless
/**
 * Helper Function: Get (child) theme version
 * This function is to properly add version number to scripts and styles.
 * @since 0.1.0
 */
function tamatebako_child_theme_version()
{
    if (is_child_theme()) {
        $theme = wp_get_theme(get_stylesheet());
        return $theme->get('Version');
    }
    return tamatebako_theme_version();
}
コード例 #2
0
ファイル: scripts.php プロジェクト: WPDevHQ/nevertheless
/**
 * Register Scripts
 */
function nevertheless_register_scripts()
{
    global $tamatebako;
    $name = $tamatebako->name;
    /* FitVids (JS) */
    wp_register_script("fitvids", tamatebako_theme_file("assets/js/jquery.fitvids", "js"), array('jquery'), '1.1.0', true);
    /* Theme Custom (JS) */
    wp_register_script("{$name}-script", tamatebako_theme_file("assets/js/jquery.theme", "js"), array('jquery', 'fitvids'), tamatebako_theme_version(), true);
    /* === CSS === */
    /* Genericons */
    wp_register_style("genericons", tamatebako_theme_file("assets/genericons/genericons", "css"), array(), '3.3.1', 'all');
    /* Theme Debug */
    wp_register_style("{$name}-debug", tamatebako_theme_file("assets/css/base/debug", "css"), array());
}
コード例 #3
0
ファイル: tamatebako.php プロジェクト: Harreh/magicowl
/**
 * Register CSS
 * Stylesheet can be loaded using 'hybrid-core-styles' theme support.
 * @since 0.1.0
 */
function tamatebako_register_css()
{
    /* Google Fonts: Open Sans / font-family: 'Open Sans', sans-serif; */
    wp_register_style('theme-open-sans-font', tamatebako_google_open_sans_font_url(), array(), tamatebako_theme_version(), 'all');
    /* Google Fonts: Open Sans / font-family: 'Merriweather', serif; */
    wp_register_style('theme-merriweather-font', tamatebako_google_merriweather_font_url(), array(), tamatebako_theme_version(), 'all');
    /* Reset CSS */
    $reset_css = tamatebako_theme_file("css/reset", "css");
    if (!empty($reset_css)) {
        wp_register_style('theme-reset', $reset_css, array(), tamatebako_theme_version(), 'all');
    }
    /* Menus CSS */
    $menus_css = tamatebako_theme_file("css/menus", "css");
    if (!empty($menus_css)) {
        wp_register_style('theme-menus', $menus_css, array(), tamatebako_theme_version(), 'all');
    }
    /* Media Queries CSS */
    $media_queries_css = tamatebako_theme_file("css/media-queries", "css");
    if (!empty($media_queries_css)) {
        wp_register_style('media-queries', $media_queries_css, array(), tamatebako_theme_version(), 'all');
    }
    /* Debug Media Queries */
    $debug_mq_css = tamatebako_theme_file("css/debug-media-queries", "css");
    if (!empty($debug_mq_css)) {
        wp_register_style('debug-media-queries', $debug_mq_css, array(), tamatebako_theme_version(), 'all');
    }
    /* Flexslider (private use) */
    $flexslider_css = tamatebako_theme_file("css/flexslider", "css");
    if (!empty($flexslider_css)) {
        wp_register_style('theme-flexslider', $flexslider_css, array(), '2.2.2', 'all');
    }
    /* Theme Custom */
    $theme_css = tamatebako_theme_file("css/theme", "css");
    if (!empty($theme_css)) {
        wp_register_style('theme', $theme_css, array(), tamatebako_theme_version(), 'all');
    }
}
コード例 #4
0
ファイル: custom-fonts.php プロジェクト: WPDevHQ/nevertheless
/**
 * Enqueue ( Google ) Fonts
 */
function tamatebako_fonts_enqueue_scripts()
{
    $google_fonts_url = tamatebako_fonts_all_google_url();
    if (!empty($google_fonts_url)) {
        wp_enqueue_style('tamatebako-custom-fonts', $google_fonts_url, array(), tamatebako_theme_version(), 'all');
    }
}
コード例 #5
0
ファイル: color.php プロジェクト: WPDevHQ/nevertheless
/**
 * Preview JS
 * @since 1.0.0
 */
function nevertheless_customize_preview_js()
{
    /* Color */
    wp_enqueue_script('nevertheless-customizer-color', trailingslashit(get_template_directory_uri()) . 'assets/js/customizer-color.js', array('jquery', 'customize-preview'), tamatebako_theme_version(), true);
}
コード例 #6
0
ファイル: tamatebako.php プロジェクト: turtlepod/cara
/**
 * Enqueue Media Queries Debug CSS
 * @since 0.1.0
 */
function tamatebako_debug_enqueue_media_queries()
{
    wp_enqueue_style('debug-media-queries', trailingslashit(get_template_directory_uri()) . 'css/debug-media-queries.css', array(), tamatebako_theme_version(), 'all');
}
コード例 #7
0
ファイル: custom-css.php プロジェクト: WPDevHQ/nevertheless
/**
 * JS to load changes asynchronously.
 */
function tamatebako_custom_css_customizer_js()
{
    global $tamatebako;
    $js = trailingslashit(get_template_directory_uri()) . $tamatebako->dir . '/modules/custom-css/custom-css.js';
    wp_enqueue_script('tamatebako_custom_css_preview', $js, array('customize-preview'), tamatebako_theme_version(), true);
}
コード例 #8
0
ファイル: setup.php プロジェクト: WPDevHQ/nevertheless
/**
 * Register Scripts
 * @since 3.0.0
 */
function tamatebako_styles()
{
    global $tamatebako;
    /* == Register Main (Parent Theme) CSS == */
    $stylesheet_uri = get_stylesheet_uri();
    $parent_css = tamatebako_get_parent_stylesheet_uri();
    $parent_css = is_child_theme() ? $parent_css : $stylesheet_uri;
    if ($parent_css) {
        wp_register_style(sanitize_title($tamatebako->name . '-style'), esc_url($parent_css), array(), tamatebako_theme_version(), 'all');
    }
    /* == Register Child Theme CSS ( Only if child theme active ) == */
    if (is_child_theme()) {
        wp_register_style(sanitize_title($tamatebako->child . '-style'), esc_url($stylesheet_uri), array(sanitize_title($tamatebako->name) . '-style'), tamatebako_child_theme_version(), 'all');
    }
}