File manager - Edit - /home/contenidosenred/public_html/OD/wp-admin/includes/219846/twentynineteen.zip
Back
PK ,am[��X;� � style-editor-customizer.scssnu �[��� /*! Twenty Nineteen Customizer Styles NOTE: This file is automatically populated with styles if the user selects a custom primary color in the customizer. */PK ,am[UF�|1 |1 inc/block-patterns.phpnu �[��� <?php /** * Block Patterns * * @link https://developer.wordpress.org/reference/functions/register_block_pattern/ * @link https://developer.wordpress.org/reference/functions/register_block_pattern_category/ * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.8 */ /** * Register Block Pattern Category. */ if ( function_exists( 'register_block_pattern_category' ) ) { register_block_pattern_category( 'twentynineteen', array( 'label' => esc_html__( 'Twenty Nineteen', 'twentynineteen' ) ) ); } /** * Register Block Patterns. */ if ( function_exists( 'register_block_pattern' ) ) { // About. register_block_pattern( 'twentynineteen/about', array( 'title' => esc_html__( 'About', 'twentynineteen' ), 'categories' => array( 'twentynineteen' ), 'content' => implode( '', array( '<!-- wp:paragraph {"fontSize":"huge","style":{"typography":{"lineHeight":"1.3"}}} -->', '<p class="has-huge-font-size" style="line-height:1.3">' . esc_html__( 'Advocating for Businesses and Entrepreneurs since 2014', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph -->', '<!-- wp:paragraph -->', '<p>' . esc_html__( 'Eva Young Consulting was founded in 2014 to meet the needs of small businesses in the San Francisco Bay Area. We help startups define a clear brand identity and digital strategy that will carry them through their financing rounds and scale as their business grows. Discover how we can boost your brand with a unique and powerful digital marketing strategy.', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph -->', '<!-- wp:buttons -->', '<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"dark-gray"} -->', '<div class="wp-block-button"><a class="wp-block-button__link has-dark-gray-background-color has-background">' . esc_html__( 'Learn More', 'twentynineteen' ) . '</a></div>', '<!-- /wp:button --></div>', '<!-- /wp:buttons -->', ) ), ) ); // Get In Touch. register_block_pattern( 'twentynineteen/get-in-touch', array( 'title' => esc_html__( 'Get In Touch', 'twentynineteen' ), 'categories' => array( 'twentynineteen' ), 'content' => implode( '', array( '<!-- wp:paragraph {"fontSize":"huge"} -->', '<p class="has-huge-font-size">' . esc_html__( 'Get In Touch', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph -->', '<!-- wp:columns -->', '<div class="wp-block-columns"><!-- wp:column -->', '<div class="wp-block-column"><!-- wp:paragraph -->', '<p>' . esc_html__( '20 Cooper Avenue', 'twentynineteen' ) . '<br>' . esc_html__( 'New York, New York 10023', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div>', '<!-- /wp:column -->', '<!-- wp:column -->', '<div class="wp-block-column"><!-- wp:paragraph -->', '<p>' . esc_html__( '(555) 555-5555', 'twentynineteen' ) . '<br><a href="mailto:example@example.com">' . esc_html__( 'example@example.com', 'twentynineteen' ) . '</a></p>', '<!-- /wp:paragraph --></div>', '<!-- /wp:column --></div>', '<!-- /wp:columns -->', '<!-- wp:buttons -->', '<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"dark-gray"} -->', '<div class="wp-block-button"><a class="wp-block-button__link has-dark-gray-background-color has-background">' . esc_html__( 'Contact Us', 'twentynineteen' ) . '</a></div>', '<!-- /wp:button --></div>', '<!-- /wp:buttons -->', ) ), ) ); // Services. register_block_pattern( 'twentynineteen/services', array( 'title' => esc_html__( 'Services', 'twentynineteen' ), 'categories' => array( 'twentynineteen' ), 'content' => implode( '', array( '<!-- wp:heading -->', '<h2>' . esc_html__( 'Services', 'twentynineteen' ) . '</h2>', '<!-- /wp:heading -->', '<!-- wp:columns {"className":"has-2-columns"} -->', '<div class="wp-block-columns has-2-columns"><!-- wp:column -->', '<div class="wp-block-column"><!-- wp:media-text {"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/pattern_01.jpg","mediaType":"image","mediaWidth":10,"isStackedOnMobile":false} -->', '<div class="wp-block-media-text alignwide" style="grid-template-columns:10% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_01.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->', '<p>' . esc_html__( 'Website Design', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text -->', '<!-- wp:media-text {"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/pattern_02.jpg","mediaType":"image","mediaWidth":10,"isStackedOnMobile":false} -->', '<div class="wp-block-media-text alignwide" style="grid-template-columns:10% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_02.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->', '<p>' . esc_html__( 'Mobile', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text -->', '<!-- wp:media-text {"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/pattern_03.jpg","mediaType":"image","mediaWidth":10,"isStackedOnMobile":false} -->', '<div class="wp-block-media-text alignwide" style="grid-template-columns:10% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_03.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->', '<p>' . esc_html__( 'Social Media', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text --></div>', '<!-- /wp:column -->', '<!-- wp:column -->', '<div class="wp-block-column"><!-- wp:media-text {"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/pattern_03.jpg","mediaType":"image","mediaWidth":10,"isStackedOnMobile":false} -->', '<div class="wp-block-media-text alignwide" style="grid-template-columns:10% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_03.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->', '<p>' . esc_html__( 'Marketing', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text -->', '<!-- wp:media-text {"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/pattern_04.jpg","mediaType":"image","mediaWidth":10,"isStackedOnMobile":false} -->', '<div class="wp-block-media-text alignwide" style="grid-template-columns:10% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_04.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->', '<p>' . esc_html__( 'Copywriting', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text -->', '<!-- wp:media-text {"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/images/pattern_01.jpg","mediaType":"image","mediaWidth":10,"isStackedOnMobile":false} -->', '<div class="wp-block-media-text alignwide" style="grid-template-columns:10% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_01.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->', '<p>' . esc_html__( 'Content Strategy', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text --></div>', '<!-- /wp:column --></div>', '<!-- /wp:columns -->', ) ), ) ); // Team. register_block_pattern( 'twentynineteen/team', array( 'title' => esc_html__( 'Team', 'twentynineteen' ), 'categories' => array( 'twentynineteen' ), 'viewportWidth' => 1400, 'content' => implode( '', array( '<!-- wp:heading -->', '<h2>' . esc_html__( 'Team', 'twentynineteen' ) . '</h2>', '<!-- /wp:heading -->', '<!-- wp:media-text {"mediaType":"image","mediaWidth":28,"imageFill":true} -->', '<div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill" style="grid-template-columns:28% auto"><figure class="wp-block-media-text__media" style="background-image:url(' . esc_url( get_template_directory_uri() ) . '/images/pattern_01.jpg);background-position:50% 50%"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_01.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"level":3} -->', '<h3>' . esc_html__( 'Eva Young', 'twentynineteen' ) . '</h3>', '<!-- /wp:heading -->', '<!-- wp:paragraph -->', '<p>' . esc_html__( 'Eva Young grew up working alongside her parents at their restaurant in Queens, NY. She opened Eva Young Consulting in 2014 to help small businesses like her parents’ restaurant adapt to the digital age.', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text -->', '<!-- wp:media-text {"mediaType":"image","mediaWidth":28,"imageFill":true} -->', '<div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill" style="grid-template-columns:28% auto"><figure class="wp-block-media-text__media" style="background-image:url(' . esc_url( get_template_directory_uri() ) . '/images/pattern_02.jpg);background-position:50% 50%"><img src="' . esc_url( get_template_directory_uri() ) . '/images/pattern_02.jpg" alt="' . esc_html__( 'Gradient', 'twentynineteen' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"level":3} -->', '<h3>' . esc_html__( 'Doug Watson', 'twentynineteen' ) . '</h3>', '<!-- /wp:heading -->', '<!-- wp:paragraph -->', '<p>' . esc_html__( 'Oddly enough, Doug Watson also grew up working alongside his parents at a family-owned restaurant in Queens, NY. He worked on digital campaigns for Fortune 500 Companies before joining Eva Green Consulting.', 'twentynineteen' ) . '</p>', '<!-- /wp:paragraph --></div></div>', '<!-- /wp:media-text -->', ) ), ) ); // What We Do. register_block_pattern( 'twentynineteen/what-we-do', array( 'title' => esc_html__( 'What We Do', 'twentynineteen' ), 'categories' => array( 'twentynineteen' ), 'viewportWidth' => 1400, 'content' => implode( '', array( '<!-- wp:heading -->', '<h2>' . esc_html__( 'What We Do', 'twentynineteen' ) . '</h2>', '<!-- /wp:heading -->', '<!-- wp:pullquote {"align":"wide","className":"is-style-solid-color"} -->', '<figure class="wp-block-pullquote alignwide is-style-solid-color"><blockquote><p>' . esc_html__( 'Redefine brands', 'twentynineteen' ) . '</p><cite>' . esc_html__( 'We help startups define (or refine) a clear brand identity.', 'twentynineteen' ) . '</cite></blockquote></figure>', '<!-- /wp:pullquote -->', '<!-- wp:pullquote {"mainColor":"dark-gray","customTextColor":"#ffffff","align":"wide","className":"is-style-solid-color"} -->', '<figure class="wp-block-pullquote alignwide has-background has-dark-gray-background-color is-style-solid-color"><blockquote class="has-text-color" style="color:#ffffff"><p>' . esc_html__( 'Activate new customers', 'twentynineteen' ) . '</p><cite>' . esc_html__( 'We help businesses grow.', 'twentynineteen' ) . '</cite></blockquote></figure>', '<!-- /wp:pullquote -->', '<!-- wp:pullquote {"customMainColor":"#f7f7f7","customTextColor":"#111111","align":"wide","className":"is-style-solid-color"} -->', '<figure class="wp-block-pullquote alignwide has-background is-style-solid-color" style="background-color:#f7f7f7"><blockquote class="has-text-color" style="color:#111111"><p>' . esc_html__( 'Spark interest on social media', 'twentynineteen' ) . '</p><cite>' . esc_html__( 'We help companies communicate with their customers.', 'twentynineteen' ) . '</cite></blockquote></figure>', '<!-- /wp:pullquote -->', ) ), ) ); } PK ,am[��� � inc/icon-functions.phpnu �[��� <?php /** * SVG icons related functions * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ /** * Gets the SVG code for a given icon. */ function twentynineteen_get_icon_svg( $icon, $size = 24 ) { return TwentyNineteen_SVG_Icons::get_svg( 'ui', $icon, $size ); } /** * Gets the SVG code for a given social icon. */ function twentynineteen_get_social_icon_svg( $icon, $size = 24 ) { return TwentyNineteen_SVG_Icons::get_svg( 'social', $icon, $size ); } /** * Detects the social network from a URL and returns the SVG code for its icon. */ function twentynineteen_get_social_link_svg( $uri, $size = 24 ) { return TwentyNineteen_SVG_Icons::get_social_link_svg( $uri, $size ); } /** * Display SVG icons in social links menu. * * @param string $item_output The menu item's starting HTML output. * @param WP_Post $item Menu item data object. * @param int $depth Depth of the menu. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @return string The menu item output with social icon. */ function twentynineteen_nav_menu_social_icons( $item_output, $item, $depth, $args ) { // Change SVG icon inside social links menu if there is supported URL. if ( 'social' === $args->theme_location ) { $svg = twentynineteen_get_social_link_svg( $item->url, 26 ); if ( empty( $svg ) ) { $svg = twentynineteen_get_icon_svg( 'link' ); } $item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons', 10, 4 ); /** * Add a dropdown icon to top-level menu items. * * @param string $item_output The menu item's starting HTML output. * @param WP_Post $item Menu item data object. * @param int $depth Depth of the menu. Used for padding. * @param stdClass $args An object of wp_nav_menu() arguments. * @return string Nav menu item start element. */ function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) { // Only add class to 'top level' items on the 'primary' menu. if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) { return $item_output; } if ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) { // Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item. // @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely. $link = sprintf( '<button class="menu-item-link-return" tabindex="-1">%s', twentynineteen_get_icon_svg( 'chevron_left', 24 ) ); // Replace opening <a> with <button>. $item_output = preg_replace( '/<a\s.*?>/', $link, $item_output, 1 // Limit. ); // Replace closing </a> with </button>. $item_output = preg_replace( '#</a>#i', '</button>', $item_output, 1 // Limit. ); } elseif ( in_array( 'menu-item-has-children', $item->classes, true ) ) { // Add SVG icon to parent items. $icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 ); $item_output .= sprintf( '<button class="submenu-expand" tabindex="-1">%s</button>', $icon ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 ); PK ,am[�s3�� � inc/template-functions.phpnu �[��� <?php /** * Functions which enhance the theme by hooking into WordPress * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function twentynineteen_body_classes( $classes ) { if ( is_singular() ) { // Adds `singular` to singular pages. $classes[] = 'singular'; } else { // Adds `hfeed` to non-singular pages. $classes[] = 'hfeed'; } // Adds a class if image filters are enabled. if ( twentynineteen_image_filters_enabled() ) { $classes[] = 'image-filters-enabled'; } return $classes; } add_filter( 'body_class', 'twentynineteen_body_classes' ); /** * Adds custom class to the array of posts classes. */ function twentynineteen_post_classes( $classes, $class, $post_id ) { $classes[] = 'entry'; return $classes; } add_filter( 'post_class', 'twentynineteen_post_classes', 10, 3 ); /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function twentynineteen_pingback_header() { if ( is_singular() && pings_open() ) { echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">'; } } add_action( 'wp_head', 'twentynineteen_pingback_header' ); /** * Changes comment form default fields. */ function twentynineteen_comment_form_defaults( $defaults ) { $comment_field = $defaults['comment_field']; // Adjust height of comment form. $defaults['comment_field'] = preg_replace( '/rows="\d+"/', 'rows="5"', $comment_field ); return $defaults; } add_filter( 'comment_form_defaults', 'twentynineteen_comment_form_defaults' ); /** * Filters the default archive titles. */ function twentynineteen_get_the_archive_title() { if ( is_category() ) { $title = __( 'Category Archives: ', 'twentynineteen' ) . '<span class="page-description">' . single_term_title( '', false ) . '</span>'; } elseif ( is_tag() ) { $title = __( 'Tag Archives: ', 'twentynineteen' ) . '<span class="page-description">' . single_term_title( '', false ) . '</span>'; } elseif ( is_author() ) { $title = __( 'Author Archives: ', 'twentynineteen' ) . '<span class="page-description">' . get_the_author_meta( 'display_name' ) . '</span>'; } elseif ( is_year() ) { $title = __( 'Yearly Archives: ', 'twentynineteen' ) . '<span class="page-description">' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentynineteen' ) ) . '</span>'; } elseif ( is_month() ) { $title = __( 'Monthly Archives: ', 'twentynineteen' ) . '<span class="page-description">' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentynineteen' ) ) . '</span>'; } elseif ( is_day() ) { $title = __( 'Daily Archives: ', 'twentynineteen' ) . '<span class="page-description">' . get_the_date() . '</span>'; } elseif ( is_post_type_archive() ) { $title = __( 'Post Type Archives: ', 'twentynineteen' ) . '<span class="page-description">' . post_type_archive_title( '', false ) . '</span>'; } elseif ( is_tax() ) { $tax = get_taxonomy( get_queried_object()->taxonomy ); /* translators: %s: Taxonomy singular name. */ $title = sprintf( esc_html__( '%s Archives:', 'twentynineteen' ), $tax->labels->singular_name ); } else { $title = __( 'Archives:', 'twentynineteen' ); } return $title; } add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' ); /** * Add custom sizes attribute to responsive image functionality for post thumbnails. * * @origin Twenty Nineteen 1.0 * * @param array $attr Attributes for the image markup. * @return string Value for use in post thumbnail 'sizes' attribute. */ function twentynineteen_post_thumbnail_sizes_attr( $attr ) { if ( is_admin() ) { return $attr; } if ( ! is_singular() ) { $attr['sizes'] = '(max-width: 34.9rem) calc(100vw - 2rem), (max-width: 53rem) calc(8 * (100vw / 12)), (min-width: 53rem) calc(6 * (100vw / 12)), 100vw'; } return $attr; } add_filter( 'wp_get_attachment_image_attributes', 'twentynineteen_post_thumbnail_sizes_attr', 10, 1 ); /** * Add an extra menu to our nav for our priority+ navigation to use * * @param string $nav_menu Nav menu. * @param object $args Nav menu args. * @return string More link for hidden menu items. */ function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) { if ( 'menu-1' === $args->theme_location ) : $nav_menu .= ' <div class="main-menu-more"> <ul class="main-menu"> <li class="menu-item menu-item-has-children"> <button class="submenu-expand main-menu-more-toggle is-empty" tabindex="-1" aria-label="' . esc_attr__( 'More', 'twentynineteen' ) . '" aria-haspopup="true" aria-expanded="false">' . twentynineteen_get_icon_svg( 'arrow_drop_down_ellipsis' ) . ' </button> <ul class="sub-menu hidden-links"> <li class="mobile-parent-nav-menu-item"> <button class="menu-item-link-return">' . twentynineteen_get_icon_svg( 'chevron_left' ) . esc_html__( 'Back', 'twentynineteen' ) . ' </button> </li> </ul> </li> </ul> </div>'; endif; return $nav_menu; } add_filter( 'wp_nav_menu', 'twentynineteen_add_ellipses_to_nav', 10, 2 ); /** * WCAG 2.0 Attributes for Dropdown Menus * * Adjustments to menu attributes tot support WCAG 2.0 recommendations * for flyout and dropdown menus. * * @ref https://www.w3.org/WAI/tutorials/menus/flyout/ */ function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) { // Add [aria-haspopup] and [aria-expanded] to menu items that have children. $item_has_children = in_array( 'menu-item-has-children', $item->classes, true ); if ( $item_has_children ) { $atts['aria-haspopup'] = 'true'; $atts['aria-expanded'] = 'false'; } return $atts; } add_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 4 ); /** * Create a nav menu item to be displayed on mobile to navigate from submenu back to the parent. * * This duplicates each parent nav menu item and makes it the first child of itself. * * @param array $sorted_menu_items Sorted nav menu items. * @param object $args Nav menu args. * @return array Amended nav menu items. */ function twentynineteen_add_mobile_parent_nav_menu_items( $sorted_menu_items, $args ) { static $pseudo_id = 0; if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) { return $sorted_menu_items; } $amended_menu_items = array(); foreach ( $sorted_menu_items as $nav_menu_item ) { $amended_menu_items[] = $nav_menu_item; if ( in_array( 'menu-item-has-children', $nav_menu_item->classes, true ) ) { $parent_menu_item = clone $nav_menu_item; $parent_menu_item->original_id = $nav_menu_item->ID; $parent_menu_item->ID = --$pseudo_id; $parent_menu_item->db_id = $parent_menu_item->ID; $parent_menu_item->object_id = $parent_menu_item->ID; $parent_menu_item->classes = array( 'mobile-parent-nav-menu-item' ); $parent_menu_item->menu_item_parent = $nav_menu_item->ID; $amended_menu_items[] = $parent_menu_item; } } return $amended_menu_items; } add_filter( 'wp_nav_menu_objects', 'twentynineteen_add_mobile_parent_nav_menu_items', 10, 2 ); PK ,am[4U�J� � inc/helper-functions.phpnu �[��� <?php /** * Common theme functions * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.5 */ /** * Determines if post thumbnail can be displayed. */ function twentynineteen_can_show_post_thumbnail() { return apply_filters( 'twentynineteen_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() ); } /** * Returns true if image filters are enabled on the theme options. */ function twentynineteen_image_filters_enabled() { return 0 !== get_theme_mod( 'image_filter', 1 ); } /** * Returns the size for avatars used in the theme. */ function twentynineteen_get_avatar_size() { return 60; } /** * Returns true if comment is by author of the post. * * @see get_comment_class() */ function twentynineteen_is_comment_by_post_author( $comment = null ) { if ( is_object( $comment ) && $comment->user_id > 0 ) { $user = get_userdata( $comment->user_id ); $post = get_post( $comment->comment_post_ID ); if ( ! empty( $user ) && ! empty( $post ) ) { return $comment->user_id === $post->post_author; } } return false; } /** * Returns information about the current post's discussion, with cache support. */ function twentynineteen_get_discussion_data() { static $discussion, $post_id; $current_post_id = get_the_ID(); if ( $current_post_id === $post_id ) { return $discussion; /* If we have discussion information for post ID, return cached object */ } else { $post_id = $current_post_id; } $comments = get_comments( array( 'post_id' => $current_post_id, 'orderby' => 'comment_date_gmt', 'order' => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings » Discussion. */ 'status' => 'approve', 'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */ ) ); $authors = array(); foreach ( $comments as $comment ) { $authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email; } $authors = array_unique( $authors ); $discussion = (object) array( 'authors' => array_slice( $authors, 0, 6 ), /* Six unique authors commenting on the post. */ 'responses' => get_comments_number( $current_post_id ), /* Number of responses. */ ); return $discussion; } /** * Converts HSL to HEX colors. */ function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) { $h /= 360; $s /= 100; $l /= 100; $r = $l; $g = $l; $b = $l; $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s ); if ( $v > 0 ) { $m = $l + $l - $v; $sv = ( $v - $m ) / $v; $h *= 6.0; $sextant = floor( $h ); $fract = $h - $sextant; $vsf = $v * $sv * $fract; $mid1 = $m + $vsf; $mid2 = $v - $vsf; switch ( $sextant ) { case 0: $r = $v; $g = $mid1; $b = $m; break; case 1: $r = $mid2; $g = $v; $b = $m; break; case 2: $r = $m; $g = $v; $b = $mid1; break; case 3: $r = $m; $g = $mid2; $b = $v; break; case 4: $r = $mid1; $g = $m; $b = $v; break; case 5: $r = $v; $g = $m; $b = $mid2; break; } } $r = round( $r * 255, 0 ); $g = round( $g * 255, 0 ); $b = round( $b * 255, 0 ); if ( $to_hex ) { $r = ( $r < 15 ) ? '0' . dechex( $r ) : dechex( $r ); $g = ( $g < 15 ) ? '0' . dechex( $g ) : dechex( $g ); $b = ( $b < 15 ) ? '0' . dechex( $b ) : dechex( $b ); return "#$r$g$b"; } return "rgb($r, $g, $b)"; } PK ,am[s9�+ + inc/color-patterns.phpnu �[��� <?php /** * Twenty Nineteen: Color Patterns * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ /** * Generate the CSS for the current primary color. */ function twentynineteen_custom_colors_css() { $primary_color = 199; if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) { $primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) ); } /** * Filters Twenty Nineteen default saturation level. * * @since Twenty Nineteen 1.0 * * @param int $saturation Color saturation level. */ $saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 ); $saturation = absint( $saturation ) . '%'; /** * Filters Twenty Nineteen default selection saturation level. * * @since Twenty Nineteen 1.0 * * @param int $saturation_selection Selection color saturation level. */ $saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) ); $saturation_selection = $saturation_selection . '%'; /** * Filters Twenty Nineteen default lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness Color lightness level. */ $lightness = apply_filters( 'twentynineteen_custom_colors_lightness', 33 ); $lightness = absint( $lightness ) . '%'; /** * Filters Twenty Nineteen default hover lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness_hover Hover color lightness level. */ $lightness_hover = apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ); $lightness_hover = absint( $lightness_hover ) . '%'; /** * Filters Twenty Nineteen default selection lightness level. * * @since Twenty Nineteen 1.0 * * @param int $lightness_selection Selection color lightness level. */ $lightness_selection = apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 ); $lightness_selection = absint( $lightness_selection ) . '%'; $theme_css = ' /* * Set background for: * - featured image :before * - featured image :before * - post thumbmail :before * - post thumbmail :before * - Submenu * - Sticky Post * - buttons * - WP Block Button * - Blocks */ .image-filters-enabled .site-header.featured-image .site-featured-image:before, .image-filters-enabled .site-header.featured-image .site-featured-image:after, .image-filters-enabled .entry .post-thumbnail:before, .image-filters-enabled .entry .post-thumbnail:after, .main-navigation .sub-menu, .sticky-post, .entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background), .entry .button, button, input[type="button"], input[type="reset"], input[type="submit"], .entry .entry-content > .has-primary-background-color, .entry .entry-content > *[class^="wp-block-"].has-primary-background-color, .entry .entry-content > *[class^="wp-block-"] .has-primary-background-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-primary-background-color, .entry .entry-content .wp-block-file .wp-block-file__button { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* * Set Color for: * - all links * - main navigation links * - Post navigation links * - Post entry meta hover * - Post entry header more-link hover * - main navigation svg * - comment navigation * - Comment edit link hover * - Site Footer Link hover * - Widget links */ a, a:visited, .main-navigation .main-menu > li, .main-navigation ul.main-menu > li > a, .post-navigation .post-title, .entry .entry-meta a:hover, .entry .entry-footer a:hover, .entry .entry-content .more-link:hover, .main-navigation .main-menu > li > a + svg, .comment .comment-metadata > a:hover, .comment .comment-metadata .comment-edit-link:hover, #colophon .site-info a:hover, .widget a, .entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), .entry .entry-content > .has-primary-color, .entry .entry-content > *[class^="wp-block-"] .has-primary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color p { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* * Set border color for: * wp block quote * :focus */ blockquote, .entry .entry-content blockquote, .entry .entry-content .wp-block-quote:not(.is-large), .entry .entry-content .wp-block-quote:not(.is-style-large), input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="number"]:focus, input[type="tel"]:focus, input[type="range"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="time"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="color"]:focus, textarea:focus { border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } .gallery-item > div > a:focus { box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* Hover colors */ a:hover, a:active, .main-navigation .main-menu > li > a:hover, .main-navigation .main-menu > li > a:hover + svg, .post-navigation .nav-links a:hover, .post-navigation .nav-links a:hover .post-title, .author-bio .author-description .author-link:hover, .entry .entry-content > .has-secondary-color, .entry .entry-content > *[class^="wp-block-"] .has-secondary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color p, .comment .comment-author .fn a:hover, .comment-reply-link:hover, .comment-navigation .nav-previous a:hover, .comment-navigation .nav-next a:hover, #cancel-comment-reply-link:hover, .widget a:hover { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ } .main-navigation .sub-menu > li > a:hover, .main-navigation .sub-menu > li > a:focus, .main-navigation .sub-menu > li > a:hover:after, .main-navigation .sub-menu > li > a:focus:after, .main-navigation .sub-menu > li > .menu-item-link-return:hover, .main-navigation .sub-menu > li > .menu-item-link-return:focus, .main-navigation .sub-menu > li > a:not(.submenu-expand):hover, .main-navigation .sub-menu > li > a:not(.submenu-expand):focus, .entry .entry-content > .has-secondary-background-color, .entry .entry-content > *[class^="wp-block-"].has-secondary-background-color, .entry .entry-content > *[class^="wp-block-"] .has-secondary-background-color, .entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-secondary-background-color { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ } /* Text selection colors */ ::selection { background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */ } ::-moz-selection { background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */ }'; $editor_css = ' /* * Set colors for: * - links * - blockquote * - pullquote (solid color) * - buttons */ .editor-block-list__layout .editor-block-list__block a, .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color), .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color), .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color), .editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } .editor-block-list__layout .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), .editor-styles-wrapper .editor-block-list__layout .wp-block-freeform blockquote { border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } .editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color:not(.has-background-color) { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } .editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__button, .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link, .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:active, .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus, .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ } /* Hover colors */ .editor-block-list__layout .editor-block-list__block a:hover, .editor-block-list__layout .editor-block-list__block a:active, .editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink:hover { color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ } /* Do not overwrite solid color pullquote or cover links */ .editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color a, .editor-block-list__layout .editor-block-list__block .wp-block-cover a { color: inherit; } '; if ( function_exists( 'register_block_type' ) && is_admin() ) { $theme_css = $editor_css; } /** * Filters Twenty Nineteen custom colors CSS. * * @since Twenty Nineteen 1.0 * * @param string $css Base theme colors CSS. * @param int $primary_color The user's selected color hue. * @param string $saturation Filtered theme color saturation level. */ return apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation ); } PK ,am[V��q� � inc/template-tags.phpnu �[��� <?php /** * Custom template tags for this theme * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ if ( ! function_exists( 'twentynineteen_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time. */ function twentynineteen_posted_on() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); printf( '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">%3$s</a></span>', twentynineteen_get_icon_svg( 'watch', 16 ), esc_url( get_permalink() ), $time_string ); } endif; if ( ! function_exists( 'twentynineteen_posted_by' ) ) : /** * Prints HTML with meta information about theme author. */ function twentynineteen_posted_by() { printf( /* translators: 1: SVG icon. 2: Post author, only visible to screen readers. 3: Author link. */ '<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>', twentynineteen_get_icon_svg( 'person', 16 ), __( 'Posted by', 'twentynineteen' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); } endif; if ( ! function_exists( 'twentynineteen_comment_count' ) ) : /** * Prints HTML with the comment count for the current post. */ function twentynineteen_comment_count() { if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo '<span class="comments-link">'; echo twentynineteen_get_icon_svg( 'comment', 16 ); /* translators: %s: Post title. Only visible to screen readers. */ comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentynineteen' ), get_the_title() ) ); echo '</span>'; } } endif; if ( ! function_exists( 'twentynineteen_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function twentynineteen_entry_footer() { // Hide author, post date, category and tag text for pages. if ( 'post' === get_post_type() ) { // Posted by. twentynineteen_posted_by(); // Posted on. twentynineteen_posted_on(); /* translators: Used between list items, there is a space after the comma. */ $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) ); if ( $categories_list ) { printf( /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of categories. */ '<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>', twentynineteen_get_icon_svg( 'archive', 16 ), __( 'Posted in', 'twentynineteen' ), $categories_list ); // WPCS: XSS OK. } /* translators: Used between list items, there is a space after the comma. */ $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) ); if ( $tags_list && ! is_wp_error( $tags_list ) ) { printf( /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of tags. */ '<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>', twentynineteen_get_icon_svg( 'tag', 16 ), __( 'Tags:', 'twentynineteen' ), $tags_list ); // WPCS: XSS OK. } } // Comment count. if ( ! is_singular() ) { twentynineteen_comment_count(); } // Edit post link. edit_post_link( sprintf( wp_kses( /* translators: %s: Post title. Only visible to screen readers. */ __( 'Edit <span class="screen-reader-text">%s</span>', 'twentynineteen' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), '<span class="edit-link">' . twentynineteen_get_icon_svg( 'edit', 16 ), '</span>' ); } endif; if ( ! function_exists( 'twentynineteen_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. */ function twentynineteen_post_thumbnail() { if ( ! twentynineteen_can_show_post_thumbnail() ) { return; } if ( is_singular() ) : ?> <figure class="post-thumbnail"> <?php the_post_thumbnail(); ?> </figure><!-- .post-thumbnail --> <?php else : ?> <figure class="post-thumbnail"> <a class="post-thumbnail-inner" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> <?php the_post_thumbnail( 'post-thumbnail' ); ?> </a> </figure> <?php endif; // End is_singular(). } endif; if ( ! function_exists( 'twentynineteen_get_user_avatar_markup' ) ) : /** * Returns the HTML markup to generate a user avatar. */ function twentynineteen_get_user_avatar_markup( $id_or_email = null ) { if ( ! isset( $id_or_email ) ) { $id_or_email = get_current_user_id(); } return sprintf( '<div class="comment-user-avatar comment-author vcard">%s</div>', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) ); } endif; if ( ! function_exists( 'twentynineteen_discussion_avatars_list' ) ) : /** * Displays a list of avatars involved in a discussion for a given post. */ function twentynineteen_discussion_avatars_list( $comment_authors ) { if ( empty( $comment_authors ) ) { return; } echo '<ol class="discussion-avatar-list">', "\n"; foreach ( $comment_authors as $id_or_email ) { printf( "<li>%s</li>\n", twentynineteen_get_user_avatar_markup( $id_or_email ) ); } echo '</ol><!-- .discussion-avatar-list -->', "\n"; } endif; if ( ! function_exists( 'twentynineteen_comment_form' ) ) : /** * Documentation for function. */ function twentynineteen_comment_form( $order ) { if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) { comment_form( array( 'logged_in_as' => null, 'title_reply' => null, ) ); } } endif; if ( ! function_exists( 'twentynineteen_the_posts_navigation' ) ) : /** * Documentation for function. */ function twentynineteen_the_posts_navigation() { the_posts_pagination( array( 'mid_size' => 2, 'prev_text' => sprintf( '%s <span class="nav-prev-text">%s</span>', twentynineteen_get_icon_svg( 'chevron_left', 22 ), __( 'Newer posts', 'twentynineteen' ) ), 'next_text' => sprintf( '<span class="nav-next-text">%s</span> %s', __( 'Older posts', 'twentynineteen' ), twentynineteen_get_icon_svg( 'chevron_right', 22 ) ), ) ); } endif; if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * * Added for backward compatibility to support pre-5.2.0 WordPress versions. * * @since Twenty Nineteen 1.4 */ function wp_body_open() { /** * Triggered after the opening <body> tag. * * @since Twenty Nineteen 1.4 */ do_action( 'wp_body_open' ); } endif; PK ,am[:�&� � inc/back-compat.phpnu �[��� <?php /** * Twenty Nineteen back compat functionality * * Prevents Twenty Nineteen from running on WordPress versions prior to 4.7, * since this theme is not meant to be backward compatible beyond that and * relies on many newer functions and markup changes introduced in 4.7. * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0.0 */ /** * Prevent switching to Twenty Nineteen on old versions of WordPress. * * Switches to the default theme. * * @since Twenty Nineteen 1.0.0 */ function twentynineteen_switch_theme() { switch_theme( WP_DEFAULT_THEME ); unset( $_GET['activated'] ); add_action( 'admin_notices', 'twentynineteen_upgrade_notice' ); } add_action( 'after_switch_theme', 'twentynineteen_switch_theme' ); /** * Adds a message for unsuccessful theme switch. * * Prints an update nag after an unsuccessful attempt to switch to * Twenty Nineteen on WordPress versions prior to 4.7. * * @since Twenty Nineteen 1.0.0 * * @global string $wp_version WordPress version. */ function twentynineteen_upgrade_notice() { printf( '<div class="error"><p>%s</p></div>', sprintf( /* translators: %s: WordPress version. */ __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ) ); } /** * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. * * @since Twenty Nineteen 1.0.0 * * @global string $wp_version WordPress version. */ function twentynineteen_customize() { wp_die( sprintf( /* translators: %s: WordPress version. */ __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ), '', array( 'back_link' => true, ) ); } add_action( 'load-customize.php', 'twentynineteen_customize' ); /** * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. * * @since Twenty Nineteen 1.0.0 * * @global string $wp_version WordPress version. */ function twentynineteen_preview() { if ( isset( $_GET['preview'] ) ) { wp_die( sprintf( /* translators: %s: WordPress version. */ __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ) ); } } add_action( 'template_redirect', 'twentynineteen_preview' ); PK ,am[���� � inc/customizer.phpnu �[��� <?php /** * Twenty Nineteen: Customizer * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function twentynineteen_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'twentynineteen_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'twentynineteen_customize_partial_blogdescription', ) ); } /** * Primary color. */ $wp_customize->add_setting( 'primary_color', array( 'default' => 'default', 'transport' => 'postMessage', 'sanitize_callback' => 'twentynineteen_sanitize_color_option', ) ); $wp_customize->add_control( 'primary_color', array( 'type' => 'radio', 'label' => __( 'Primary Color', 'twentynineteen' ), 'choices' => array( 'default' => _x( 'Default', 'primary color', 'twentynineteen' ), 'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ), ), 'section' => 'colors', 'priority' => 5, ) ); // Add primary color hue setting and control. $wp_customize->add_setting( 'primary_color_hue', array( 'default' => 199, 'transport' => 'postMessage', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_color_hue', array( 'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ), 'section' => 'colors', 'mode' => 'hue', ) ) ); // Add image filter setting and control. $wp_customize->add_setting( 'image_filter', array( 'default' => 1, 'sanitize_callback' => 'absint', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'image_filter', array( 'label' => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ), 'section' => 'colors', 'type' => 'checkbox', ) ); } add_action( 'customize_register', 'twentynineteen_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function twentynineteen_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function twentynineteen_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Bind JS handlers to instantly live-preview changes. */ function twentynineteen_customize_preview_js() { wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true ); } add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' ); /** * Load dynamic logic for the customizer controls area. */ function twentynineteen_panels_js() { wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true ); } add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' ); /** * Sanitize custom color choice. * * @param string $choice Whether image filter is active. * @return string */ function twentynineteen_sanitize_color_option( $choice ) { $valid = array( 'default', 'custom', ); if ( in_array( $choice, $valid, true ) ) { return $choice; } return 'default'; } PK ,am[n�m� � js/customize-preview.jsnu �[��� /** * File customize-preview.js. * * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ (function( $ ) { // Primary color. wp.customize( 'primary_color', function( value ) { value.bind( function( to ) { // Update custom color CSS. var style = $( '#custom-theme-colors' ), hue = style.data( 'hue' ), css = style.html(), color; if( 'custom' === to ){ // If a custom primary color is selected, use the currently set primary_color_hue. color = wp.customize.get().primary_color_hue; } else { // If the "default" option is selected, get the default primary_color_hue. color = 199; } // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed. css = css.split( hue + ',' ).join( color + ',' ); style.html( css ).data( 'hue', color ); }); }); // Primary color hue. wp.customize( 'primary_color_hue', function( value ) { value.bind( function( to ) { // Update custom color CSS. var style = $( '#custom-theme-colors' ), hue = style.data( 'hue' ), css = style.html(); // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed. css = css.split( hue + ',' ).join( to + ',' ); style.html( css ).data( 'hue', to ); }); }); // Image filter. wp.customize( 'image_filter', function( value ) { value.bind( function( to ) { if ( to ) { $( 'body' ).addClass( 'image-filters-enabled' ); } else { $( 'body' ).removeClass( 'image-filters-enabled' ); } } ); } ); })( jQuery ); PK ,am[�$-��$ �$ js/touch-keyboard-navigation.jsnu �[��� /** * Touch & Keyboard navigation. * * Contains handlers for touch devices and keyboard navigation. */ (function() { /** * Debounce. * * @param {Function} func * @param {number} wait * @param {boolean} immediate */ function debounce(func, wait, immediate) { 'use strict'; var timeout; wait = (typeof wait !== 'undefined') ? wait : 20; immediate = (typeof immediate !== 'undefined') ? immediate : true; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) { func.apply(context, args); } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) { func.apply(context, args); } }; } /** * Add class. * * @param {Object} el * @param {string} cls */ function addClass(el, cls) { if ( ! el.className.match( '(?:^|\\s)' + cls + '(?!\\S)') ) { el.className += ' ' + cls; } } /** * Delete class. * * @param {Object} el * @param {string} cls */ function deleteClass(el, cls) { el.className = el.className.replace( new RegExp( '(?:^|\\s)' + cls + '(?!\\S)' ),'' ); } /** * Has class? * * @param {Object} el * @param {string} cls * * @returns {boolean} Has class */ function hasClass(el, cls) { if ( el.className.match( '(?:^|\\s)' + cls + '(?!\\S)' ) ) { return true; } } /** * Toggle Aria Expanded state for screenreaders. * * @param {Object} ariaItem */ function toggleAriaExpandedState( ariaItem ) { 'use strict'; var ariaState = ariaItem.getAttribute('aria-expanded'); if ( ariaState === 'true' ) { ariaState = 'false'; } else { ariaState = 'true'; } ariaItem.setAttribute('aria-expanded', ariaState); } /** * Open sub-menu. * * @param {Object} currentSubMenu */ function openSubMenu( currentSubMenu ) { 'use strict'; // Update classes. // classList.add is not supported in IE11. currentSubMenu.parentElement.className += ' off-canvas'; currentSubMenu.parentElement.lastElementChild.className += ' expanded-true'; // Update aria-expanded state. toggleAriaExpandedState( currentSubMenu ); } /** * Close sub-menu. * * @param {Object} currentSubMenu */ function closeSubMenu( currentSubMenu ) { 'use strict'; var menuItem = getCurrentParent( currentSubMenu, '.menu-item' ); // this.parentNode var menuItemAria = menuItem.querySelector('a[aria-expanded]'); var subMenu = currentSubMenu.closest('.sub-menu'); // If this is in a sub-sub-menu, go back to parent sub-menu. if ( getCurrentParent( currentSubMenu, 'ul' ).classList.contains( 'sub-menu' ) ) { // Update classes. // classList.remove is not supported in IE11. menuItem.className = menuItem.className.replace( 'off-canvas', '' ); subMenu.className = subMenu.className.replace( 'expanded-true', '' ); // Update aria-expanded and :focus states. toggleAriaExpandedState( menuItemAria ); // Or else close all sub-menus. } else { // Update classes. // classList.remove is not supported in IE11. menuItem.className = menuItem.className.replace( 'off-canvas', '' ); menuItem.lastElementChild.className = menuItem.lastElementChild.className.replace( 'expanded-true', '' ); // Update aria-expanded and :focus states. toggleAriaExpandedState( menuItemAria ); } } /** * Find first ancestor of an element by selector. * * @param {Object} child * @param {String} selector * @param {String} stopSelector */ function getCurrentParent( child, selector, stopSelector ) { var currentParent = null; while ( child ) { if ( child.matches(selector) ) { currentParent = child; break; } else if ( stopSelector && child.matches(stopSelector) ) { break; } child = child.parentElement; } return currentParent; } /** * Remove all off-canvas states. */ function removeAllFocusStates() { 'use strict'; var siteBranding = document.getElementsByClassName( 'site-branding' )[0]; var getFocusedElements = siteBranding.querySelectorAll(':hover, :focus, :focus-within'); var getFocusedClassElements = siteBranding.querySelectorAll('.is-focused'); var i; var o; for ( i = 0; i < getFocusedElements.length; i++) { getFocusedElements[i].blur(); } for ( o = 0; o < getFocusedClassElements.length; o++) { deleteClass( getFocusedClassElements[o], 'is-focused' ); } } /** * Matches polyfill for IE11. */ if (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.msMatchesSelector; } /** * Toggle `focus` class to allow sub-menu access on touch screens. */ function toggleSubmenuDisplay() { document.addEventListener('touchstart', function(event) { if ( event.target.matches('a') ) { var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : ''; // Open submenu if URL is #. if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) { openSubMenu( event.target ); } } // Check if .submenu-expand is touched. if ( event.target.matches('.submenu-expand') ) { openSubMenu(event.target); // Check if child of .submenu-expand is touched. } else if ( null != getCurrentParent( event.target, '.submenu-expand' ) && getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) ) { openSubMenu( getCurrentParent( event.target, '.submenu-expand' ) ); // Check if .menu-item-link-return is touched. } else if ( event.target.matches('.menu-item-link-return') ) { closeSubMenu( event.target ); // Check if child of .menu-item-link-return is touched. } else if ( null != getCurrentParent( event.target, '.menu-item-link-return' ) && getCurrentParent( event.target, '.menu-item-link-return' ).matches( '.menu-item-link-return' ) ) { closeSubMenu( event.target ); } // Prevent default mouse/focus events. removeAllFocusStates(); }, false); document.addEventListener('touchend', function(event) { var mainNav = getCurrentParent( event.target, '.main-navigation' ); if ( null != mainNav && hasClass( mainNav, '.main-navigation' ) ) { // Prevent default mouse events. event.preventDefault(); } else if ( event.target.matches('.submenu-expand') || null != getCurrentParent( event.target, '.submenu-expand' ) && getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) || event.target.matches('.menu-item-link-return') || null != getCurrentParent( event.target, '.menu-item-link-return' ) && getCurrentParent( event.target, '.menu-item-link-return' ).matches( '.menu-item-link-return' ) ) { // Prevent default mouse events. event.preventDefault(); } // Prevent default mouse/focus events. removeAllFocusStates(); }, false); document.addEventListener('focus', function(event) { if ( event.target.matches('.main-navigation > div > ul > li a') ) { // Remove Focused elements in sibling div. var currentDiv = getCurrentParent( event.target, 'div', '.main-navigation' ); var currentDivSibling = currentDiv.previousElementSibling === null ? currentDiv.nextElementSibling : currentDiv.previousElementSibling; var focusedElement = currentDivSibling.querySelector( '.is-focused' ); var focusedClass = 'is-focused'; var prevLi = getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ).previousElementSibling; var nextLi = getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ).nextElementSibling; if ( null !== focusedElement && null !== hasClass( focusedElement, focusedClass ) ) { deleteClass( focusedElement, focusedClass ); } // Add .is-focused class to top-level li. if ( getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ) ) { addClass( getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ), focusedClass ); } // Check for previous li. if ( prevLi && hasClass( prevLi, focusedClass ) ) { deleteClass( prevLi, focusedClass ); } // Check for next li. if ( nextLi && hasClass( nextLi, focusedClass ) ) { deleteClass( nextLi, focusedClass ); } } }, true); document.addEventListener('click', function(event) { // Remove all focused menu states when clicking outside site branding. if ( event.target !== document.getElementsByClassName( 'site-branding' )[0] ) { removeAllFocusStates(); } else { // Nothing. } }, false); } /** * Run our sub-menu function as soon as the document is `ready`. */ document.addEventListener( 'DOMContentLoaded', function() { toggleSubmenuDisplay(); }); /** * Run our sub-menu function on selective refresh in the customizer. */ document.addEventListener( 'customize-preview-menu-refreshed', function( e, params ) { if ( 'menu-1' === params.wpNavMenuArgs.theme_location ) { toggleSubmenuDisplay(); } }); /** * Run our sub-menu function every time the window resizes. */ var isResizing = false; window.addEventListener( 'resize', function() { isResizing = true; debounce( function() { if ( isResizing ) { return; } toggleSubmenuDisplay(); isResizing = false; }, 150 ); } ); })(); PK ,am[Y1pk� � js/priority-menu.jsnu �[��� (function() { /** * Debounce. * * @param {Function} func * @param {number} wait * @param {boolean} immediate */ function debounce(func, wait, immediate) { 'use strict'; var timeout; wait = (typeof wait !== 'undefined') ? wait : 20; immediate = (typeof immediate !== 'undefined') ? immediate : true; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) { func.apply(context, args); } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) { func.apply(context, args); } }; } /** * Prepends an element to a container. * * @param {Element} container * @param {Element} element */ function prependElement(container, element) { if (container.firstChild.nextSibling) { return container.insertBefore(element, container.firstChild.nextSibling); } else { return container.appendChild(element); } } /** * Shows an element by adding a hidden className. * * @param {Element} element */ function showButton(element) { // classList.remove is not supported in IE11. element.className = element.className.replace('is-empty', ''); } /** * Hides an element by removing the hidden className. * * @param {Element} element */ function hideButton(element) { // classList.add is not supported in IE11. if (!element.classList.contains('is-empty')) { element.className += ' is-empty'; } } /** * Returns the currently available space in the menu container. * * @returns {number} Available space */ function getAvailableSpace( button, container ) { return container.offsetWidth - button.offsetWidth - 22; } /** * Returns whether the current menu is overflowing or not. * * @returns {boolean} Is overflowing */ function isOverflowingNavivation( list, button, container ) { return list.offsetWidth > getAvailableSpace( button, container ); } /** * Set menu container variable. */ var navContainer = document.querySelector('.main-navigation'); var breaks = []; /** * Let’s bail if we our menu doesn't exist. */ if ( ! navContainer ) { return; } /** * Refreshes the list item from the menu depending on the menu size. */ function updateNavigationMenu( container ) { /** * Let’s bail if our menu is empty. */ if ( ! container.parentNode.querySelector('.main-menu[id]') ) { return; } // Adds the necessary UI to operate the menu. var visibleList = container.parentNode.querySelector('.main-menu[id]'); var hiddenList = visibleList.parentNode.nextElementSibling.querySelector('.hidden-links'); var toggleButton = visibleList.parentNode.nextElementSibling.querySelector('.main-menu-more-toggle'); if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) { // Record the width of the list. breaks.push( visibleList.offsetWidth ); // Move last item to the hidden list. prependElement( hiddenList, ! visibleList.lastChild || null === visibleList.lastChild ? visibleList.previousElementSibling : visibleList.lastChild ); // Show the toggle button. showButton( toggleButton ); } else { // There is space for another item in the nav. if ( getAvailableSpace( toggleButton, container ) > breaks[breaks.length - 1] ) { // Move the item to the visible list. visibleList.appendChild( hiddenList.firstChild.nextSibling ); breaks.pop(); } // Hide the dropdown btn if hidden list is empty. if (breaks.length < 2) { hideButton( toggleButton ); } } // Recur if the visible list is still overflowing the nav. if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) { updateNavigationMenu( container ); } } /** * Run our priority+ function as soon as the document is `ready`. */ document.addEventListener( 'DOMContentLoaded', function() { updateNavigationMenu( navContainer ); // Also, run our priority+ function on selective refresh in the customizer. var hasSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh && wp.customize.navMenusPreview.NavMenuInstancePartial ); if ( hasSelectiveRefresh ) { // Re-run our priority+ function on Nav Menu partial refreshes. wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) { var isNewNavMenu = ( placement && placement.partial.id.includes( 'nav_menu_instance' ) && 'null' !== placement.container[0].parentNode && placement.container[0].parentNode.classList.contains( 'main-navigation' ) ); if ( isNewNavMenu ) { updateNavigationMenu( placement.container[0].parentNode ); } }); } }); /** * Run our priority+ function on load. */ window.addEventListener( 'load', function() { updateNavigationMenu( navContainer ); }); /** * Run our priority+ function every time the window resizes. */ var isResizing = false; window.addEventListener( 'resize', debounce( function() { if ( isResizing ) { return; } isResizing = true; setTimeout( function() { updateNavigationMenu( navContainer ); isResizing = false; }, 150 ); } ) ); /** * Run our priority+ function. */ updateNavigationMenu( navContainer ); })(); PK ,am[{� � js/customize-controls.jsnu �[��� /** * File customize-controls.js. * * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ (function() { wp.customize.bind( 'ready', function() { // Only show the color hue control when there's a custom primary color. wp.customize( 'primary_color', function( setting ) { wp.customize.control( 'primary_color_hue', function( control ) { var visibility = function() { if ( 'custom' === setting.get() ) { control.container.slideDown( 180 ); } else { control.container.slideUp( 180 ); } }; visibility(); setting.bind( visibility ); }); }); }); })(); PK ,am[���3 js/skip-link-focus-fix.jsnu �[��� /** * File skip-link-focus-fix.js. * * Helps with accessibility for keyboard only users. * * This is the source file for what is minified in the twentynineteen_skip_link_focus_fix() PHP function. * * Learn more: https://git.io/vWdr2 */ ( function() { var isIe = /(trident|msie)/i.test( navigator.userAgent ); if ( isIe && document.getElementById && window.addEventListener ) { window.addEventListener( 'hashchange', function() { var id = location.hash.substring( 1 ), element; if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { return; } element = document.getElementById( id ); if ( element ) { if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { element.tabIndex = -1; } element.focus(); } }, false ); } } )(); PK ,am[D�ǽ� � page.phpnu �[��� <?php /** * The template for displaying all single posts * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content/content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; // End the loop. ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer(); PK ,am[Bb`V V footer.phpnu �[��� <?php /** * The template for displaying the footer * * Contains the closing of the #content div and all content after. * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ ?> </div><!-- #content --> <footer id="colophon" class="site-footer"> <?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?> <div class="site-info"> <?php $blog_info = get_bloginfo( 'name' ); ?> <?php if ( ! empty( $blog_info ) ) : ?> <a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>, <?php endif; ?> <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentynineteen' ) ); ?>" class="imprint"> <?php /* translators: %s: WordPress. */ printf( __( 'Proudly powered by %s.', 'twentynineteen' ), 'WordPress' ); ?> </a> <?php if ( function_exists( 'the_privacy_policy_link' ) ) { the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' ); } ?> <?php if ( has_nav_menu( 'footer' ) ) : ?> <nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Footer Menu', 'twentynineteen' ); ?>"> <?php wp_nav_menu( array( 'theme_location' => 'footer', 'menu_class' => 'footer-menu', 'depth' => 1, ) ); ?> </nav><!-- .footer-navigation --> <?php endif; ?> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html> PK ,am[.��6 6 images/pattern_03.jpgnu �[��� ��� Exif II* �� Ducky <