function google_fonts_load_disable($styles)
{
    $styles->add('open-sans', '');
    // Backend
    $styles->add('twentytwelve-fonts', '');
    // Core themes ...
    $styles->add('twentythirteen-fonts', '');
    $styles->add('twentyfourteen-lato', '');
    $styles->add('twentyfifteen-fonts', '');
    $styles->add('twentysixteen-fonts', '');
    if (is_admin()) {
        // Remove Google fonts injected into WP editor
        global $editor_styles;
        if (function_exists('twentyfifteen_fonts_url')) {
            unset($editor_styles[array_search(twentyfifteen_fonts_url(), $editor_styles)]);
        }
        if (function_exists('twentysixteen_fonts_url')) {
            unset($editor_styles[array_search(twentysixteen_fonts_url(), $editor_styles)]);
        }
    }
}
Пример #2
0
/**
 * Enqueues scripts and styles.
 *
 * @since Twenty Sixteen 1.0
 */
function twentysixteen_scripts()
{
    // Add custom fonts, used in the main stylesheet.
    wp_enqueue_style('twentysixteen-fonts', twentysixteen_fonts_url(), array(), null);
    // Add Genericons, used in the main stylesheet.
    wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1');
    // Theme stylesheet.
    wp_enqueue_style('twentysixteen-style', get_stylesheet_uri());
    // Load the Internet Explorer specific stylesheet.
    wp_enqueue_style('twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array('twentysixteen-style'), '20150930');
    wp_style_add_data('twentysixteen-ie', 'conditional', 'lt IE 10');
    // Load the Internet Explorer 8 specific stylesheet.
    wp_enqueue_style('twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array('twentysixteen-style'), '20151230');
    wp_style_add_data('twentysixteen-ie8', 'conditional', 'lt IE 9');
    // Load the Internet Explorer 7 specific stylesheet.
    wp_enqueue_style('twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array('twentysixteen-style'), '20150930');
    wp_style_add_data('twentysixteen-ie7', 'conditional', 'lt IE 8');
    // Load the html5 shiv.
    wp_enqueue_script('twentysixteen-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3');
    wp_script_add_data('twentysixteen-html5', 'conditional', 'lt IE 9');
    wp_enqueue_script('twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151112', true);
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    if (is_singular() && wp_attachment_is_image()) {
        wp_enqueue_script('twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array('jquery'), '20151104');
    }
    wp_enqueue_script('twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array('jquery'), '20151204', true);
    wp_localize_script('twentysixteen-script', 'screenReaderText', array('expand' => __('expand child menu', 'twentysixteen'), 'collapse' => __('collapse child menu', 'twentysixteen')));
}
Пример #3
0
function twentysixteen_setup()
{
    /**
     * already overrided in child 
     * load_theme_textdomain( 'twentysixteenchild', get_template_directory() . '/languages' );
     */
    // Add default posts and comments RSS feed links to head.
    add_theme_support('automatic-feed-links');
    add_theme_support('title-tag');
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(1200, 0, true);
    //set the size as u like
    // This theme uses wp_nav_menu() in two locations, plus
    //added new menu position in child
    register_nav_menus(array('primary' => __('Primary Menu', 'twentysixteenchild'), 'social' => __('Social Links Menu', 'twentysixteenxhild'), 'footer' => __('Footer Menu', 'twentysixteenxhild')));
    /*
     * Switch default core markup for search form, comment form, and comments
     * add remove as needed
     */
    add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
    /*
     * Enable support for Post Formats.
     *
     * See: https://codex.wordpress.org/Post_Formats
     * add remove as u needed
     */
    add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'));
    /*
     * you can override new for url by adding new function in child
     */
    add_editor_style(array('css/editor-style.css', twentysixteen_fonts_url()));
}
Пример #4
0
 public function filters_after_setup_theme()
 {
     // add filter
     if (false !== $this->conf['patch_force_character_count']) {
         if ('characters_including_spaces' != _x('words', 'Word count type. Do not translate!')) {
             add_filter('gettext_with_context', array($this, 'force_character_count'), 10, 3);
         }
     }
     if (false !== $this->conf['patch_force_twentytwelve_open_sans_off'] && 'twentytwelve' == get_template()) {
         add_action('wp_enqueue_scripts', array($this, 'force_twentytwelve_open_sans_off'), 99);
         add_action('admin_print_styles-appearance_page_custom-header', array($this, 'force_twentytwelve_open_sans_off'), 99);
     }
     if (false !== $this->conf['patch_force_twentythirteen_google_fonts_off'] && 'twentythirteen' == get_template()) {
         add_action('wp_enqueue_scripts', array($this, 'force_twentythirteen_google_fonts_off'), 99);
         add_action('admin_print_styles-appearance_page_custom-header', array($this, 'force_twentythirteen_google_fonts_off'), 99);
     }
     if (false !== $this->conf['patch_force_twentyfourteen_google_fonts_off'] && 'twentyfourteen' == get_template()) {
         add_action('wp_enqueue_scripts', array($this, 'force_twentyfourteen_google_fonts_off'), 99);
         add_action('admin_print_scripts-appearance_page_custom-header', array($this, 'force_twentyfourteen_google_fonts_off'), 99);
     }
     if (false !== $this->conf['patch_force_twentyfifteen_google_fonts_off'] && 'twentyfifteen' == get_template()) {
         add_action('wp_enqueue_scripts', array($this, 'force_twentyfifteen_google_fonts_off'), 99);
         if (function_exists('twentyfifteen_fonts_url')) {
             $this->remove_editor_style(twentyfifteen_fonts_url());
         }
     }
     if (false !== $this->conf['patch_force_twentysixteen_google_fonts_off'] && 'twentysixteen' == get_template()) {
         add_action('wp_enqueue_scripts', array($this, 'force_twentysixteen_google_fonts_off'), 99);
         if (function_exists('twentysixteen_fonts_url')) {
             $this->remove_editor_style(twentysixteen_fonts_url());
         }
     }
 }
Пример #5
0
/**
 * Enqueues scripts and styles.
 *
 * @since Zoom Construction Theme 1.0
 */
function twentysixteen_scripts()
{
    // Add custom fonts, used in the main stylesheet.
    wp_enqueue_style('twentysixteen-fonts', twentysixteen_fonts_url(), array(), null);
    // Add Genericons, used in the main stylesheet.
    wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1');
    //add bootstrap css
    wp_enqueue_style('bootstrap-css', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.6');
    wp_enqueue_style('swipe-css', get_template_directory_uri() . '/css/swipe.css', array(), '2.0');
    // Theme stylesheet.
    wp_enqueue_style('twentysixteen-style', get_stylesheet_uri());
    wp_enqueue_script('twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151112', true);
    if (is_singular() && wp_attachment_is_image()) {
        wp_enqueue_script('twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array('jquery'), '20151104');
    }
    wp_enqueue_script('twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array('jquery'), '20151204', true);
    wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.6', true);
    wp_enqueue_script('swipe-js', get_template_directory_uri() . '/js/swipe.js', array('jquery'), '2.0', true);
    wp_localize_script('twentysixteen-script', 'screenReaderText', array('expand' => __('expand child menu', 'twentysixteen'), 'collapse' => __('collapse child menu', 'twentysixteen')));
}
Пример #6
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  *
  * Create your own twentysixteen_setup() function to override in a child theme.
  *
  * @since Twenty Sixteen 1.0
  */
 function twentysixteen_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on Twenty Sixteen, use a find and replace
      * to change 'twentysixteen' to the name of your theme in all the template files
      */
     load_theme_textdomain('twentysixteen', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     /*
      * Let WordPress manage the document title.
      * By adding theme support, we declare that this theme does not use a
      * hard-coded <title> tag in the document head, and expect WordPress to
      * provide it for us.
      */
     add_theme_support('title-tag');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(1200, 9999);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('primary' => __('Primary Menu', 'twentysixteen'), 'social' => __('Social Links Menu', 'twentysixteen')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     /*
      * Enable support for Post Formats.
      *
      * See: https://codex.wordpress.org/Post_Formats
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'));
     /*
      * This theme styles the visual editor to resemble the theme style,
      * specifically font, colors, icons, and column width.
      */
     add_editor_style(array('css/editor-style.css', twentysixteen_fonts_url()));
 }