/** * Enqueue scripts and styles. */ function twentyseventeen_scripts() { // Add custom fonts, used in the main stylesheet. wp_enqueue_style('twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null); // Theme stylesheet. wp_enqueue_style('twentyseventeen-style', get_stylesheet_uri()); // Load the dark colorscheme. if ('dark' === get_theme_mod('colorscheme', 'light') || is_customize_preview()) { wp_enqueue_style('twentyseventeen-colors-dark', get_theme_file_uri('/assets/css/colors-dark.css'), array('twentyseventeen-style'), '1.0'); } // Load the Internet Explorer 9 specific stylesheet, to fix display issues in the Customizer. if (is_customize_preview()) { wp_enqueue_style('twentyseventeen-ie9', get_theme_file_uri('/assets/css/ie9.css'), array('twentyseventeen-style'), '1.0'); wp_style_add_data('twentyseventeen-ie9', 'conditional', 'IE 9'); } // Load the Internet Explorer 8 specific stylesheet. wp_enqueue_style('twentyseventeen-ie8', get_theme_file_uri('/assets/css/ie8.css'), array('twentyseventeen-style'), '1.0'); wp_style_add_data('twentyseventeen-ie8', 'conditional', 'lt IE 9'); // Load the html5 shiv. wp_enqueue_script('html5', get_theme_file_uri('/assets/js/html5.js'), array(), '3.7.3'); wp_script_add_data('html5', 'conditional', 'lt IE 9'); wp_enqueue_script('twentyseventeen-skip-link-focus-fix', get_theme_file_uri('/assets/js/skip-link-focus-fix.js'), array(), '1.0', true); $twentyseventeen_l10n = array('quote' => twentyseventeen_get_svg(array('icon' => 'quote-right'))); if (has_nav_menu('top')) { wp_enqueue_script('twentyseventeen-navigation', get_theme_file_uri('/assets/js/navigation.js'), array(), '1.0', true); $twentyseventeen_l10n['expand'] = __('Expand child menu', 'twentyseventeen'); $twentyseventeen_l10n['collapse'] = __('Collapse child menu', 'twentyseventeen'); $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg(array('icon' => 'angle-down', 'fallback' => true)); } wp_enqueue_script('twentyseventeen-global', get_theme_file_uri('/assets/js/global.js'), array('jquery'), '1.0', true); wp_enqueue_script('jquery-scrollto', get_theme_file_uri('/assets/js/jquery.scrollTo.js'), array('jquery'), '2.1.2', true); wp_localize_script('twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } }
/** * Prints HTML with meta information for the categories, tags and comments. */ function twentyseventeen_entry_footer() { /* translators: used between list items, there is a space after the comma */ $separate_meta = __(', ', 'twentyseventeen'); // Get Categories for posts. $categories_list = get_the_category_list($separate_meta); // Get Tags for posts. $tags_list = get_the_tag_list('', $separate_meta); // We don't want to output .entry-footer if it will be empty, so make sure its not. if (twentyseventeen_categorized_blog() && $categories_list || $tags_list || get_edit_post_link()) { echo '<footer class="entry-footer">'; if ('post' === get_post_type()) { if ($categories_list && twentyseventeen_categorized_blog() || $tags_list) { echo '<span class="cat-tags-links">'; // Make sure there's more than one category before displaying. if ($categories_list && twentyseventeen_categorized_blog()) { echo '<span class="cat-links">' . twentyseventeen_get_svg(array('icon' => 'folder-open')) . '<span class="screen-reader-text">' . __('Categories', 'twentyseventeen') . '</span>' . $categories_list . '</span>'; } if ($tags_list) { echo '<span class="tags-links">' . twentyseventeen_get_svg(array('icon' => 'hashtag')) . '<span class="screen-reader-text">' . __('Tags', 'twentyseventeen') . '</span>' . $tags_list . '</span>'; } echo '</span>'; } } twentyseventeen_edit_link(); echo '</footer> <!-- .entry-footer -->'; } }
*/ get_header(); ?> <div class="wrap"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php /* Start the Loop */ while (have_posts()) { the_post(); get_template_part('template-parts/post/content', get_post_format()); // If comments are open or we have at least one comment, load up the comment template. if (comments_open() || get_comments_number()) { comments_template(); } the_post_navigation(array('prev_text' => '<span class="screen-reader-text">' . __('Previous Post', 'twentyseventeen') . '</span><span aria-hidden="true" class="nav-subtitle">' . __('Previous', 'twentyseventeen') . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg(array('icon' => 'arrow-left')) . '</span>%title</span>', 'next_text' => '<span class="screen-reader-text">' . __('Next Post', 'twentyseventeen') . '</span><span aria-hidden="true" class="nav-subtitle">' . __('Next', 'twentyseventeen') . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg(array('icon' => 'arrow-right')) . '</span></span>')); } // End of the loop. ?> </main><!-- #main --> </div><!-- #primary --> <?php get_sidebar(); ?> </div><!-- .wrap --> <?php get_footer();
<?php $description = get_bloginfo('description', 'display'); if ($description || is_customize_preview()) { ?> <p class="site-description"><?php echo $description; ?> </p> <?php } ?> </div><!-- .site-branding-text --> <?php if ((twentyseventeen_is_frontpage() || is_home() && is_front_page()) && !has_nav_menu('top')) { ?> <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg(array('icon' => 'arrow-right')); ?> <span class="screen-reader-text"><?php _e('Scroll down to content', 'twentyseventeen'); ?> </span></a> <?php } ?> </div><!-- .wrap --> </div><!-- .site-branding -->
* @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php if (is_sticky() && is_home()) { echo twentyseventeen_get_svg(array('icon' => 'thumb-tack')); } ?> <header class="entry-header"> <?php if ('post' === get_post_type()) { echo '<div class="entry-meta">'; if (is_single()) { twentyseventeen_posted_on(); } else { echo twentyseventeen_time_link(); twentyseventeen_edit_link(); } echo '</div><!-- .entry-meta -->'; } if (is_single()) {
echo esc_url(home_url('/')); ?> "> <label for="<?php echo $unique_id; ?> "> <span class="screen-reader-text"><?php echo _x('Search for:', 'label', 'twentyseventeen'); ?> </span> </label> <input type="search" id="<?php echo $unique_id; ?> " class="search-field" placeholder="<?php echo esc_attr_x('Search …', 'placeholder', 'twentyseventeen'); ?> " value="<?php echo get_search_query(); ?> " name="s" /> <button type="submit" class="search-submit"><?php echo twentyseventeen_get_svg(array('icon' => 'search')); ?> <span class="screen-reader-text"><?php echo _x('Search', 'submit button', 'twentyseventeen'); ?> </span></button> </form>
<main id="main" class="site-main" role="main"> <?php if (have_posts()) { ?> <?php /* Start the Loop */ while (have_posts()) { the_post(); /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part('template-parts/post/content', get_post_format()); } the_posts_pagination(array('prev_text' => twentyseventeen_get_svg(array('icon' => 'arrow-left')) . '<span class="screen-reader-text">' . __('Previous page', 'twentyseventeen') . '</span>', 'next_text' => '<span class="screen-reader-text">' . __('Next page', 'twentyseventeen') . '</span>' . twentyseventeen_get_svg(array('icon' => 'arrow-right')), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'twentyseventeen') . ' </span>')); } else { get_template_part('template-parts/post/content', 'none'); } ?> </main><!-- #main --> </div><!-- #primary --> <?php get_sidebar(); ?> </div><!-- .wrap --> <?php get_footer();
/** * Customize video play/pause button in the custom header. */ function twentyseventeen_video_controls($settings) { $settings['l10n']['play'] = '<span class="screen-reader-text">' . __('Play background video', 'twentyseventeen') . '</span>' . twentyseventeen_get_svg(array('icon' => 'play')); $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __('Pause background video', 'twentyseventeen') . '</span>' . twentyseventeen_get_svg(array('icon' => 'pause')); return $settings; }
?> </div><!-- #content --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="wrap"> <?php get_template_part('template-parts/footer/footer', 'widgets'); if (has_nav_menu('social')) { ?> <nav class="social-navigation" role="navigation" aria-label="<?php _e('Footer Social Links Menu', 'twentyseventeen'); ?> "> <?php wp_nav_menu(array('theme_location' => 'social', 'menu_class' => 'social-links-menu', 'depth' => 1, 'link_before' => '<span class="screen-reader-text">', 'link_after' => '</span>' . twentyseventeen_get_svg(array('icon' => 'chain')))); ?> </nav><!-- .social-navigation --> <?php } get_template_part('template-parts/footer/site', 'info'); ?> </div><!-- .wrap --> </footer><!-- #colophon --> </div><!-- .site-content-contain --> </div><!-- #page --> <?php wp_footer(); ?> </body>
/** * Add dropdown icon if menu item has children. * * @param string $title The menu item's title. * @param object $item The current menu item. * @param array $args An array of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. * @return string $title The menu item's title with dropdown icon. */ function twentyseventeen_dropdown_icon_to_menu_link($title, $item, $args, $depth) { if ('top' === $args->theme_location) { foreach ($item->classes as $value) { if ('menu-item-has-children' === $value || 'page_item_has_children' === $value) { $title = $title . twentyseventeen_get_svg(array('icon' => 'angle-down')); } } } return $title; }
/* translators: %s: post title */ printf(_x('One Reply to “%s”', 'comments title', 'twentyseventeen'), get_the_title()); } else { printf(_nx('%1$s Reply to “%2$s”', '%1$s Replies to “%2$s”', $comments_number, 'comments title', 'twentyseventeen'), number_format_i18n($comments_number), get_the_title()); } ?> </h2> <ol class="comment-list"> <?php wp_list_comments(array('avatar_size' => 100, 'style' => 'ol', 'short_ping' => true, 'reply_text' => twentyseventeen_get_svg(array('icon' => 'mail-reply')) . __('Reply', 'twentyseventeen'))); ?> </ol> <?php the_comments_pagination(array('prev_text' => twentyseventeen_get_svg(array('icon' => 'arrow-left')) . '<span class="screen-reader-text">' . __('Previous', 'twentyseventeen') . '</span>', 'next_text' => '<span class="screen-reader-text">' . __('Next', 'twentyseventeen') . '</span>' . twentyseventeen_get_svg(array('icon' => 'arrow-right')))); } // Check for have_comments(). // If comments are closed and there are comments, let's leave a little note, shall we? if (!comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')) { ?> <p class="no-comments"><?php _e('Comments are closed.', 'twentyseventeen'); ?> </p> <?php } comment_form(); ?>