/**
  * 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.
  *
  * @since Twenty Fifteen 1.0
  */
 function twentyfifteen_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on twentyfifteen, use a find and replace
      * to change 'twentyfifteen' to the name of your theme in all the template files
      */
     load_theme_textdomain('twentyfifteen', 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.
      *
      * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(825, 510, true);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('primary' => __('Primary Menu', 'twentyfifteen'), 'top_header' => __('Top Header Menu', 'twentyfifteen'), 'social' => __('Social Links Menu', 'twentyfifteen')));
     /*
      * 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'));
     $color_scheme = twentyfifteen_get_color_scheme();
     $default_color = trim($color_scheme[0], '#');
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('twentyfifteen_custom_background_args', array('default-color' => $default_color, 'default-attachment' => 'fixed')));
     /*
      * 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', 'genericons/genericons.css', twentyfifteen_fonts_url()));
     /* image size */
     add_image_size('menu-image', 127, 140, 1);
     add_image_size('fire-image', 208, 232, 1);
     /* Set default local timezone */
     date_default_timezone_set(get_field('default_timezone', 'option'));
 }
示例#2
0
/**
 * Add postMessage support for site title and description for the Customizer.
 *
 * @since Twenty Fifteen 1.0
 *
 * @param WP_Customize_Manager $wp_customize Customizer object.
 */
function twentyfifteen_customize_register($wp_customize)
{
    $color_scheme = twentyfifteen_get_color_scheme();
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    // Add color scheme setting and control.
    $wp_customize->add_setting('color_scheme', array('default' => 'default', 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', 'transport' => 'postMessage'));
    $wp_customize->add_setting('color_scheme_css', array('default' => '', 'sanitize_callback' => 'esc_html', 'transport' => 'postMessage'));
    $wp_customize->add_control('color_scheme', array('label' => esc_html__('Base Color Scheme', 'twentyfifteen'), 'section' => 'colors', 'type' => 'select', 'choices' => twentyfifteen_get_color_scheme_choices(), 'priority' => 1));
    // Add custom header and sidebar text color setting and control.
    $wp_customize->add_setting('sidebar_textcolor', array('default' => $color_scheme[4], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'sidebar_textcolor', array('label' => esc_html__('Header and Sidebar Text Color', 'twentyfifteen'), 'description' => esc_html__('Only applied to the sidebar on wider screens. On small screens the sidebar will become the header.', 'twentyfifteen'), 'section' => 'colors')));
    // Remove the core header textcolor control, as it shares the sidebar text color.
    $wp_customize->remove_control('header_textcolor');
    // Add custom header and sidebar background color setting and control.
    $wp_customize->add_setting('header_background_color', array('default' => $color_scheme[1], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array('label' => esc_html__('Header and Sidebar Background Color', 'twentyfifteen'), 'description' => esc_html__('Only applied to the sidebar on wider screens. On small screens the sidebar will become the header.', 'twentyfifteen'), 'section' => 'colors')));
    // Add an additional description to the header image section.
    $wp_customize->get_section('header_image')->description = esc_html__('Only applied to the sidebar on wide screens. On small screens it will be applied to the header.', 'twentyfifteen');
}
示例#3
0
/** CUSTOM HEADER SETUP 
 * Set up the WordPress core custom header feature.
 *
 * @uses twentyfifteen_header_style()
 */
function webcomic2015_custom_header_setup()
{
    remove_action('after_setup_theme', 'twentyfifteen_custom_header_setup');
    $color_scheme = twentyfifteen_get_color_scheme();
    $default_text_color = trim($color_scheme[4], '#');
    /**
     * Filter Twenty Fifteen custom-header support arguments.
     *
     * @since Twenty Fifteen 1.0
     *
     * @param array $args {
     *     An array of custom-header support arguments.
     *
     *     @type string $default_text_color     Default color of the header text.
     *     @type int    $width                  Width in pixels of the custom header image. Default 954.
     *     @type int    $height                 Height in pixels of the custom header image. Default 1300.
     *     @type string $wp-head-callback       Callback function used to styles the header image and text
     *                                          displayed on the blog.
     * }
     */
    add_theme_support('custom-header', apply_filters('twentyfifteen_custom_header_args', array('default-text-color' => $default_text_color, 'width' => 1300, 'height' => 1300, 'wp-head-callback' => 'twentyfifteen_header_style')));
}
示例#4
0
/**
 * Enqueues front-end CSS for the sidebar text color.
 *
 * @since Twenty Fifteen 1.0
 */
function twentyfifteen_sidebar_text_color_css()
{
    $color_scheme = twentyfifteen_get_color_scheme();
    $default_color = $color_scheme[4];
    $sidebar_link_color = get_theme_mod('sidebar_textcolor', $default_color);
    // Don't do anything if the current color is the default.
    if ($sidebar_link_color === $default_color) {
        return;
    }
    // If we get this far, we have custom styles. Let's do this.
    $sidebar_link_color_rgb = twentyfifteen_hex2rgb($sidebar_link_color);
    $sidebar_text_color = vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $sidebar_link_color_rgb);
    $sidebar_border_color = vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $sidebar_link_color_rgb);
    $sidebar_border_focus_color = vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $sidebar_link_color_rgb);
    $css = '
		/* Custom Sidebar Text Color */
		.site-title a,
		.site-description,
		.secondary-toggle:before {
			color: %1$s;
		}

		.site-title a:hover,
		.site-title a:focus {
			color: %1$s; /* Fallback for IE7 and IE8 */
			color: %2$s;
		}

		.secondary-toggle {
			border-color: %1$s; /* Fallback for IE7 and IE8 */
			border-color: %3$s;
		}

		.secondary-toggle:hover,
		.secondary-toggle:focus {
			border-color: %1$s; /* Fallback for IE7 and IE8 */
			border-color: %4$s;
		}

		.site-title a {
			outline-color: %1$s; /* Fallback for IE7 and IE8 */
			outline-color: %4$s;
		}

		@media screen and (min-width: 59.6875em) {
			.secondary a,
			.dropdown-toggle:after,
			.widget-title,
			.widget blockquote cite,
			.widget blockquote small {
				color: %1$s;
			}

			.widget button,
			.widget input[type="button"],
			.widget input[type="reset"],
			.widget input[type="submit"],
			.widget_calendar tbody a {
				background-color: %1$s;
			}

			.textwidget a {
				border-color: %1$s;
			}

			.secondary a:hover,
			.secondary a:focus,
			.main-navigation .menu-item-description,
			.widget,
			.widget blockquote,
			.widget .wp-caption-text,
			.widget .gallery-caption {
				color: %2$s;
			}

			.widget button:hover,
			.widget button:focus,
			.widget input[type="button"]:hover,
			.widget input[type="button"]:focus,
			.widget input[type="reset"]:hover,
			.widget input[type="reset"]:focus,
			.widget input[type="submit"]:hover,
			.widget input[type="submit"]:focus,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus {
				background-color: %2$s;
			}

			.widget blockquote {
				border-color: %2$s;
			}

			.main-navigation ul,
			.main-navigation li,
			.secondary-toggle,
			.widget input,
			.widget textarea,
			.widget table,
			.widget th,
			.widget td,
			.widget pre,
			.widget li,
			.widget_categories .children,
			.widget_nav_menu .sub-menu,
			.widget_pages .children,
			.widget abbr[title] {
				border-color: %3$s;
			}

			.dropdown-toggle:hover,
			.dropdown-toggle:focus,
			.widget hr {
				background-color: %3$s;
			}

			.widget input:focus,
			.widget textarea:focus {
				border-color: %4$s;
			}

			.sidebar a:focus,
			.dropdown-toggle:focus {
				outline-color: %4$s;
			}
		}
	';
    wp_add_inline_style('twentyfifteen-style', sprintf($css, $sidebar_link_color, $sidebar_text_color, $sidebar_border_color, $sidebar_border_focus_color));
}
示例#5
0
/**
 * Enqueues front-end CSS for color scheme.
 *
 * @since Twenty Fifteen 1.0
 *
 * @see wp_add_inline_style()
 */
function twentyfifteen_color_scheme_css()
{
    $color_scheme_option = get_theme_mod('color_scheme', 'default');
    // Don't do anything if the default color scheme is selected.
    if ('default' === $color_scheme_option) {
        return;
    }
    $color_scheme = twentyfifteen_get_color_scheme();
    // Convert main and sidebar text hex color to rgba.
    $color_textcolor_rgb = twentyfifteen_hex2rgb($color_scheme[3]);
    $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb($color_scheme[4]);
    $colors = array('background_color' => $color_scheme[0], 'header_background_color' => $color_scheme[1], 'box_background_color' => $color_scheme[2], 'textcolor' => $color_scheme[3], 'secondary_textcolor' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb), 'border_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb), 'border_focus_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb), 'sidebar_textcolor' => $color_scheme[4], 'sidebar_border_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb), 'sidebar_border_focus_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb), 'secondary_sidebar_textcolor' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb), 'meta_box_background_color' => $color_scheme[5]);
    $color_scheme_css = twentyfifteen_get_color_scheme_css($colors);
    wp_add_inline_style('twentyfifteen-style', $color_scheme_css);
}
示例#6
0
/**
 * Enqueues front-end CSS for color scheme.
 *
 * @since Twenty Fifteen 1.0
 */
function twentyfifteen_color_scheme_css()
{
    $color_scheme_option = get_theme_mod('color_scheme', 'default');
    // Don't do anything if the default color scheme is selected.
    if ('default' === $color_scheme_option) {
        return;
    }
    // If we get this far, we have custom styles. Let's do this.
    $color_scheme = twentyfifteen_get_color_scheme();
    // Convert main and sidebar text hex color to rgba.
    $color_main_text_rgb = twentyfifteen_hex2rgb($color_scheme[3]);
    $color_sidebar_link_rgb = twentyfifteen_hex2rgb($color_scheme[4]);
    $color_background = $color_scheme[0];
    $color_sidebar_background = $color_scheme[1];
    $color_box_background = $color_scheme[2];
    $color_main_text = $color_scheme[3];
    $color_secondary_text = vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_main_text_rgb);
    $color_border = vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_main_text_rgb);
    $color_border_focus = vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_main_text_rgb);
    $color_sidebar_link = $color_scheme[4];
    $color_sidebar_text = vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_link_rgb);
    $color_sidebar_border = vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_link_rgb);
    $color_sidebar_border_focus = vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_link_rgb);
    $color_meta_box = $color_scheme[5];
    $css = '
		/* Color Scheme */

		/* Background Color */
		body {
			background-color: %1$s;
		}

		/* Sidebar Background Color */
		body:before,
		.site-header {
			background-color: %2$s;
		}

		/* Box Background Color */
		.post-navigation,
		.pagination,
		.secondary,
		.site-footer,
		.hentry,
		.page-header,
		.page-content,
		.comments-area {
			background-color: %3$s;
		}

		/* Box Background Color */
		button,
		input[type="button"],
		input[type="reset"],
		input[type="submit"],
		.pagination .prev,
		.pagination .next,
		.pagination .prev:before,
		.pagination .next:before,
		.entry-content .page-links a,
		.entry-content .page-links a:hover,
		.entry-content .page-links a:focus,
		.sticky-post {
			color: %3$s;
		}

		/* Main Text Color */
		button,
		input[type="button"],
		input[type="reset"],
		input[type="submit"],
		.pagination .prev,
		.pagination .next,
		.page-links a,
		.sticky-post {
			background-color: %4$s;
		}

		/* Main Text Color */
		body,
		blockquote cite,
		blockquote small,
		a,
		.image-navigation a:hover,
		.image-navigation a:focus,
		.comment-navigation a:hover,
		.comment-navigation a:focus,
		.entry-footer a:hover,
		.entry-footer a:focus,
		.comment-metadata a:hover,
		.comment-metadata a:focus,
		.pingback .edit-link a:hover,
		.pingback .edit-link a:focus,
		.comment-list .reply a:hover,
		.comment-list .reply a:focus,
		.site-info a:hover,
		.site-info a:focus {
			color: %4$s;
		}

		/* Main Text Color */
		.entry-content a,
		.entry-summary a,
		.page-content a,
		.comment-content a,
		.author-description a,
		.comment-list .reply a:hover,
		.comment-list .reply a:focus {
			border-color: %4$s;
		}

		/* Secondary Text Color */
		button:hover,
		button:focus,
		input[type="button"]:hover,
		input[type="button"]:focus,
		input[type="reset"]:hover,
		input[type="reset"]:focus,
		input[type="submit"]:hover,
		input[type="submit"]:focus,
		.pagination .prev:hover,
		.pagination .prev:focus,
		.pagination .next:hover,
		.pagination .next:focus,
		.page-links a:hover,
		.page-links a:focus {
			background-color: %4$s; /* Fallback for IE7 and IE8 */
			background-color: %5$s;
		}

		/* Secondary Text Color */
		blockquote,
		input[type="text"],
		input[type="email"],
		input[type="url"],
		input[type="password"],
		input[type="search"],
		textarea,
		a:hover,
		a:focus,
		.post-navigation .meta-nav,
		.post-navigation a:hover .post-title,
		.post-navigation a:focus .post-title,
		.image-navigation,
		.image-navigation a,
		.comment-navigation,
		.comment-navigation a,
		.author-heading,
		.entry-footer,
		.entry-footer a,
		.taxonomy-description,
		.page-links > .page-links-title,
		.entry-caption,
		.comment-author,
		.comment-metadata,
		.comment-metadata a,
		.pingback .comment-edit-link,
		.post-password-form label,
		.comment-form label,
		.comment-notes,
		.comment-awaiting-moderation,
		.logged-in-as,
		.form-allowed-tags,
		.no-comments,
		.site-info,
		.site-info a,
		.wp-caption-text,
		.gallery-caption,
		.comment-list .reply a {
			color: %4$s; /* Fallback for IE7 and IE8 */
			color: %5$s;
		}

		/* Secondary Text Color */
		blockquote,
		.entry-content a:hover,
		.entry-content a:focus,
		.entry-summary a:hover,
		.entry-summary a:focus,
		.page-content a:hover,
		.page-content a:focus,
		.comment-content a:hover,
		.comment-content a:focus,
		.author-description a:hover,
		.author-description a:focus {
			border-color: %4$s; /* Fallback for IE7 and IE8 */
			border-color: %5$s;
		}

		/* Border Color */
		hr {
			background-color: %4$s; /* Fallback for IE7 and IE8 */
			background-color: %6$s;
		}

		/* Border Color */
		pre,
		abbr[title],
		table,
		th,
		td,
		input,
		textarea,
		.post-navigation,
		.post-navigation .nav-previous:not(.has-post-thumbnail) + .nav-next:not(.has-post-thumbnail),
		.pagination,
		.comment-navigation,
		.site-header,
		.site-footer,
		.hentry + .hentry,
		.author-info,
		.entry-content .page-links a,
		.page-links > span,
		.page-header,
		.comments-area,
		.comment-list + .comment-respond,
		.comment-list article,
		.comment-list .pingback,
		.comment-list .trackback,
		.comment-list .reply a,
		.no-comments {
			border-color: %4$s; /* Fallback for IE7 and IE8 */
			border-color: %6$s;
		}

		/* Border Focus Color */
		input:focus,
		textarea:focus {
			border-color: %4$s; /* Fallback for IE7 and IE8 */
			border-color: %7$s;
		}

		/* Sidebar Link Color */
		.secondary-toggle:hover {
			border-color: %8$s;
		}

		.secondary-toggle:before {
			color: %8$s;
		}

		.secondary-toggle:focus {
			outline-color: %8$s;
		}

		.site-title a,
		.site-description {
			color: %8$s;
		}

		/* Sidebar Text Color */
		.site-title a:hover,
		.site-title a:focus {
			color: %9$s;
		}

		/* Sidebar Border Color */
		.secondary-toggle {
			border-color: %8$s; /* Fallback for IE7 and IE8 */
			border-color: %10$s;
		}

		/* Meta Background Color */
		.entry-footer {
			background-color: %12$s;
		}

		@media screen and (min-width: 38.75em) {
			/* Main Text Color */
			.page-header {
				border-color: %4$s;
			}
		}

		@media screen and (min-width: 59.6875em) {
			/* Make sure its transparent on desktop */
			.site-header,
			.secondary {
				background-color: transparent;
			}

			/* Sidebar Background Color */
			.widget button,
			.widget input[type="button"],
			.widget input[type="reset"],
			.widget input[type="submit"],
			.widget_calendar tbody a,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus,
			.widget mark,
			.widget ins {
				color: %2$s;
			}

			/* Sidebar Link Color */
			.widget button,
			.widget input[type="button"],
			.widget input[type="reset"],
			.widget input[type="submit"],
			.widget_calendar tbody a,
			.widget mark,
			.widget ins {
				background-color: %8$s;
			}

			.secondary a,
			.dropdown-toggle:after,
			.widget-title,
			.widget blockquote cite,
			.widget blockquote small {
				color: %8$s;
			}

			.dropdown-toggle:focus {
				outline-color: %8$s;
			}

			/* Sidebar Text Color */
			.secondary a:hover,
			.secondary a:focus,
			.widget,
			.main-navigation .menu-item-description,
			.widget blockquote,
			.widget .wp-caption-text,
			.widget .gallery-caption {
				color: %9$s;
			}

			.dropdown-toggle:hover,
			.dropdown-toggle:focus,
			.widget button:hover,
			.widget button:focus,
			.widget input[type="button"]:hover,
			.widget input[type="button"]:focus,
			.widget input[type="reset"]:hover,
			.widget input[type="reset"]:focus,
			.widget input[type="submit"]:hover,
			.widget input[type="submit"]:focus,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus {
				background-color: %9$s;
			}

			.widget blockquote {
				border-color: %9$s;
			}

			/* Sidebar Border Color */
			.main-navigation ul,
			.main-navigation li,
			.widget input,
			.widget textarea,
			.widget table,
			.widget th,
			.widget td,
			.widget input,
			.widget textarea,
			.widget pre,
			.widget li,
			.widget_categories .children,
			.widget_nav_menu .sub-menu,
			.widget_pages .children,
			.widget abbr[title] {
				border-color: %10$s;
			}

			.widget hr {
				background-color: %10$s;
			}

			/* Sidebar Border Focus Color */
			.widget input:focus,
			.widget textarea:focus {
				border-color: %11$s;
			}
		}
	';
    wp_add_inline_style('twentyfifteen-style', sprintf($css, $color_background, $color_sidebar_background, $color_box_background, $color_main_text, $color_secondary_text, $color_border, $color_border_focus, $color_sidebar_link, $color_sidebar_text, $color_sidebar_border, $color_sidebar_border_focus, $color_meta_box));
}
    /**
     * Custom header image markup displayed on the Appearance > Header admin panel.
     *
     * @since Twenty Fifteen 1.0
     * @see twentyfifteen_custom_header_setup().
     */
    function twentyfifteen_admin_header_image()
    {
        $style = sprintf(' style="color:#%s;"', get_header_textcolor());
        $color_scheme = twentyfifteen_get_color_scheme();
        $header_background_color = get_theme_mod('header_background_color', $color_scheme[1]);
        ?>
	<div id="headimg" style="background-image: url(<?php 
        header_image();
        ?>
); background-color: <?php 
        echo esc_attr($header_background_color);
        ?>
;">
		<h1 class="displaying-header-text"><a id="name"<?php 
        echo $style;
        ?>
 onclick="return false;" href="<?php 
        echo esc_url(home_url('/'));
        ?>
"><?php 
        bloginfo('name');
        ?>
</a></h1>
		<div id="desc" class="displaying-header-text"<?php 
        echo $style;
        ?>
><?php 
        bloginfo('description');
        ?>
</div>
	</div>
<?php 
    }
 /**
  * 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.
  *
  * @since Twenty Fifteen 1.0
  */
 function twentyfifteen_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen
      * If you're building a theme based on twentyfifteen, use a find and replace
      * to change 'twentyfifteen' to the name of your theme in all the template files
      */
     load_theme_textdomain('twentyfifteen');
     // 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.
      *
      * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(825, 510, true);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('primary' => __('Primary Menu', 'twentyfifteen'), 'social' => __('Social Links Menu', 'twentyfifteen')));
     /*
      * 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'));
     /*
      * Enable support for custom logo.
      *
      * @since Twenty Fifteen 1.5
      */
     add_theme_support('custom-logo', array('height' => 248, 'width' => 248, 'flex-height' => true));
     $color_scheme = twentyfifteen_get_color_scheme();
     $default_color = trim($color_scheme[0], '#');
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('twentyfifteen_custom_background_args', array('default-color' => $default_color, 'default-attachment' => 'fixed')));
     /*
      * 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', 'genericons/genericons.css', twentyfifteen_fonts_url()));
     // Indicate widget sidebars can use selective refresh in the Customizer.
     add_theme_support('customize-selective-refresh-widgets');
 }
示例#9
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.
  *
  * @since Twenty Fifteen 1.0
  */
 function twentyfifteen_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on twentyfifteen, use a find and replace
      * to change 'twentyfifteen' to the name of your theme in all the template files
      */
     load_theme_textdomain('twentyfifteen', 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.
      *
      * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(825, 510, true);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('primary' => __('Primary Menu', 'twentyfifteen'), 'footer' => __('Footer Menu', 'twentyfifteen'), 'top-header' => __('Top Header Menu', 'twentyfifteen'), 'our-products' => __('Our Products Menu', 'twentyfifteen'), 'career-nav' => __('Career details page navigation menu', 'twentyfifteen'), 'about-nav' => __('About us page navigation menu', 'twentyfifteen'), 'engineering-nav' => __('Engineering details page navigation menu', 'twentyfifteen'), 'responsibility-nav' => __('Resposibility details page navigation menu', 'twentyfifteen'), 'our-business-nav' => __('Our Business page navigation menu', 'twentyfifteen'), 'media-nav' => __('Media navigation menu', 'twentyfifteen'), 'social' => __('Social Links Menu', 'twentyfifteen')));
     /*
      * 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'));
     $color_scheme = twentyfifteen_get_color_scheme();
     $default_color = trim($color_scheme[0], '#');
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('twentyfifteen_custom_background_args', array('default-color' => $default_color, 'default-attachment' => 'fixed')));
     /*
      * 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', 'genericons/genericons.css', twentyfifteen_fonts_url()));
     add_image_size('banner_image', 2000, 568);
     add_image_size('home_portfolio_banner_image', 1109, 346);
     add_image_size('home_main_image', 570, 196);
     add_image_size('home_what_we_do_image', 585, 400);
     add_image_size('home_career_image', 376, 238);
     add_image_size('home_latest_news_image', 121, 110);
     add_image_size('who_we_are_page_image', 266, 292);
     add_image_size('who_we_are_certification_image', 264, 171);
     add_image_size('portfolio_image', 555, 332);
     add_image_size('portfolio_gallery_image', 1118, 582);
     add_image_size('career_page_image', 266, 200);
     add_image_size('career_search_image', 560, 367);
     add_image_size('leadership_list_image', 220, 124);
     add_image_size('omega_frontline_image', 460, 259);
 }