コード例 #1
0
ファイル: functions.php プロジェクト: WPDevHQ/nevertheless
/**
 * Setup
 */
function nevertheless_theme_setup()
{
    /* === MINIMUM SYSTEM REQ === */
    $back_compat_args = array('theme_name' => 'Nevertheless', 'wp_requires' => '4.1.0', 'php_requires' => '5.2.4');
    add_theme_support('tamatebako-back-compat', $back_compat_args);
    if (!tamatebako_minimum_requirement($back_compat_args)) {
        return;
    }
    /* === TRANSLATION === */
    tamatebako_include('includes/translation');
    /* === SCRIPTS === */
    tamatebako_include('includes/scripts');
    /* === CUSTOM FONTS === */
    tamatebako_include('includes/custom-fonts');
    /* === SETUP: Sidebars, Menus, Image Sizes, Content Width === */
    tamatebako_include('includes/setup');
    /* === LAYOUTS === */
    tamatebako_include('includes/layouts');
    /* === BACKGROUND === */
    tamatebako_include('includes/background');
    /* === HEADER IMAGE === */
    tamatebako_include('includes/header-image');
    /* === COLOR === */
    tamatebako_include('includes/color');
    /* === LOGO === */
    tamatebako_include('includes/logo');
    /* === UTILITY: Mobile View, Custom CSS === */
    tamatebako_include('includes/utility');
}
コード例 #2
0
ファイル: customizer.php プロジェクト: WPDevHQ/nevertheless
/**
 * Registers Customizer sections, settings, and controls
 */
function tamatebako_layouts_customizer_register($wp_customize)
{
    /* Load Layout Customizer Class */
    tamatebako_include('modules/layouts/customizer-control', true);
    /* Add the layout section. */
    $wp_customize->add_section('layout', array('title' => esc_html(tamatebako_layouts_string('layout'))));
    // Add the layout setting.
    $wp_customize->add_setting('theme_layout', array('default' => tamatebako_layout_default(), 'sanitize_callback' => 'sanitize_key', 'transport' => 'refresh'));
    // Add the layout control.
    $wp_customize->add_control(new Tamatebako_Customize_Layout($wp_customize, 'theme_layout', array()));
}
コード例 #3
0
ファイル: customizer.php プロジェクト: WPDevHQ/nevertheless
/**
 * Registers Customizer sections, settings, and controls
 */
function tamatebako_fonts_customizer_register($wp_customize)
{
    /* Custom Control */
    tamatebako_include('modules/custom-fonts/customizer-control', true);
    /* Load All Google Fonts in Customizer */
    add_action('customize_controls_print_styles', 'tametebako_fonts_customize_styles');
    /* == CONFIG == */
    $config = tamatebako_fonts_config();
    $labels = tamatebako_fonts_label();
    /* Panel. */
    $wp_customize->add_panel('fonts', array('title' => esc_html($labels['fonts'])));
    /* Create Sections From Config */
    foreach ($config as $section => $section_data) {
        /* Section. */
        $wp_customize->add_section($section, array('title' => esc_html($section_data['label']), 'description' => isset($section_data['description']) ? $section_data['description'] : '', 'panel' => 'fonts'));
        /* Setting */
        $wp_customize->add_setting($section, array('default' => $section_data['default'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'tamatebako_fonts_sanitize'));
        /* Control */
        $wp_customize->add_control(new Tamatebako_Custom_Fonts_Customize($wp_customize, $section, array('section' => $section, 'settings' => $section, 'choices' => tamatebako_fonts_format_choices($section_data['fonts']))));
    }
}
コード例 #4
0
ファイル: post-meta.php プロジェクト: WPDevHQ/nevertheless
/**
 * Setup Layouts Meta Box & Options
 */
function tamatebako_layouts_admin_setup()
{
    /* Load meta boxes functions. */
    tamatebako_include('modules/layouts/post-meta-box', true);
}
コード例 #5
0
ファイル: custom-fonts.php プロジェクト: WPDevHQ/nevertheless
        echo "\n" . '<style type="text/css" id="tamatebako-custom-fonts-rules-css">' . trim($css) . '</style>' . "\n";
    }
}
/* Add body classes */
add_filter('body_class', 'tamatebako_fonts_body_class');
/**
 * Custom Font: Body Class Status
 */
function tamatebako_fonts_body_class($classes)
{
    /* Add active status */
    $classes[] = 'custom-fonts-active';
    /* Get fonts config */
    $config = tamatebako_fonts_config();
    /* Foreach setting */
    foreach ($config as $section => $section_data) {
        /* format font name */
        $font = get_theme_mod($section, $section_data['default']);
        $font = 'tf-' . $section . '-' . $font;
        $font = strtolower($font);
        $font = str_replace(' ', '-', $font);
        /* Add class */
        $classes[] = sanitize_html_class($font);
    }
    return array_unique($classes);
}
/* === EDITOR STYLE === */
$settings = tamatebako_fonts_settings();
if (isset($settings['editor_styles']) && !empty($settings['editor_styles'])) {
    tamatebako_include('modules/custom-fonts/editor-style', true);
}
コード例 #6
0
ファイル: layouts.php プロジェクト: WPDevHQ/nevertheless
    return get_theme_mod('theme_layout', tamatebako_layout_default());
}
/* === ADD BODY CLASS === */
/* Filters the body_class hook to add a custom class. */
add_filter('body_class', 'tamatebako_layouts_body_class');
/**
 * Adds the post layout class to the body class in the form of "layout-$layout".
 */
function tamatebako_layouts_body_class($classes)
{
    $current_layout = tamatebako_current_layout();
    if (!empty($current_layout)) {
        $classes[] = sanitize_html_class('layout-' . tamatebako_current_layout());
    }
    return array_unique($classes);
}
/* === LOAD === */
/* Get Features */
$layouts_args = tamatebako_layouts_args();
/**
 * Load Layouts Post Meta
 */
if (true === $layouts_args['post_meta']) {
    tamatebako_include('modules/layouts/post-meta', true);
}
/**
 * Load Layouts Customizer
 */
if (true === $layouts_args['customize']) {
    tamatebako_include('modules/layouts/customizer', true);
}
コード例 #7
0
ファイル: tamatebako.php プロジェクト: WPDevHQ/nevertheless
if (!is_admin()) {
    /* General */
    tamatebako_include('functions/template/general', true);
    /* Navigation Menu */
    tamatebako_include('functions/template/menu', true);
    /* Sidebar */
    tamatebako_include('functions/template/sidebar', true);
    /* Entry */
    tamatebako_include('functions/template/entry', true);
    /* Attachment */
    tamatebako_include('functions/template/attachment', true);
    /* Comment */
    tamatebako_include('functions/template/comment', true);
    /* Load front-end utility functions for faster development ( min PHP 5.3 ) */
    if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
        tamatebako_include('functions/template/utility', true);
    }
}
/* === LOAD MODULES === */
/* Load custom theme features. */
add_action('after_setup_theme', 'tamatebako_load_theme_support', 15);
/**
 * Load various modules only when theme add supports for it.
 * 
 * @since 3.0.0
 * @return void
 */
function tamatebako_load_theme_support()
{
    /* === BACK COMPAT === */
    tamatebako_require_if_theme_supports('tamatebako-back-compat', 'modules/back-compat');