'posts' ) ); // Custom header add_theme_support( 'custom-header', array( 'header-text' => false, 'height' => 198, 'uploads' => true, 'width' => 1440, ) ); // Content width global $content_width; if ( ! isset( $content_width ) ) $content_width = 640; // Custom background add_theme_support( 'custom-background', array( 'default-color' => 'f6f6f6' ) ); // Add nav menu register_nav_menu( 'primary', __( 'Primary Menu', 'iwata' ) ); // Title Tag add_theme_support( "title-tag" ); // Make the theme translation ready load_theme_textdomain( 'iwata', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) { require_once( $locale_file ); } } add_action( 'after_setup_theme', 'iwata_setup' ); endif; /* --------------------------------------------------------------------------------------------- INCLUDE REQUIRED FILES --------------------------------------------------------------------------------------------- */ // Customizer class require get_template_directory() . '/inc/classes/class-iwata-customize.php'; /* --------------------------------------------------------------------------------------------- REGISTER AND ENQUEUE SCRIPTS --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_load_javascript_files' ) ) : function iwata_load_javascript_files() { $theme_version = wp_get_theme( 'iwata' )->get( 'Version' ); wp_register_script( 'iwata_doubletap', get_template_directory_uri() . '/assets/js/doubletaptogo.js' ); wp_enqueue_script( 'iwata_global', get_template_directory_uri() . '/assets/js/global.js', array( 'jquery', 'iwata_doubletap' ), $theme_version, true ); if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'iwata_load_javascript_files' ); endif; /* --------------------------------------------------------------------------------------------- REGISTER AND ENQUEUE STYLES --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_load_style' ) ) : function iwata_load_style() { if ( is_admin() ) return; $theme_version = wp_get_theme( 'iwata' )->get( 'Version' ); $dependencies = array(); wp_register_style( 'iwata_googleFonts', get_theme_file_uri( '/assets/css/fonts.css' ) ); $dependencies[] = 'iwata_googleFonts'; wp_register_style( 'iwata_fontawesome', get_template_directory_uri() . '/assets/fonts/fa/css/font-awesome.css' ); $dependencies[] = 'iwata_fontawesome'; wp_enqueue_style( 'iwata_style', get_template_directory_uri() . '/style.css', $dependencies, $theme_version ); } add_action( 'wp_print_styles', 'iwata_load_style' ); endif; /* --------------------------------------------------------------------------------------------- ADD EDITOR STYLES --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_add_editor_styles' ) ) : function iwata_add_editor_styles() { add_editor_style( array( 'assets/css/iwata-classic-editor-styles.css', 'assets/css/fonts.css' ) ); } add_action( 'init', 'iwata_add_editor_styles' ); endif; /* --------------------------------------------------------------------------------------------- CHECK WHETHER THE BROWSER SUPPORTS JS --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_html_js_class' ) ) : function iwata_html_js_class () { echo ''. "\n"; } add_action( 'wp_head', 'iwata_html_js_class', 1 ); endif; /* --------------------------------------------------------------------------------------------- ADD CLASSES TO NEXT/PREVIOUS POSTS LINKS --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_next_posts_link_attributes' ) ) : function iwata_next_posts_link_attributes() { return 'class="archive-nav-older"'; } add_filter( 'next_posts_link_attributes', 'iwata_next_posts_link_attributes' ); endif; if ( ! function_exists( 'iwata_previous_posts_link_attributes' ) ) : function iwata_previous_posts_link_attributes() { return 'class="archive-nav-newer"'; } add_filter( 'previous_posts_link_attributes', 'iwata_previous_posts_link_attributes' ); endif; /* --------------------------------------------------------------------------------------------- CUSTOM MORE LINK TEXT --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_custom_more_link' ) ) : function iwata_custom_more_link( $more_link, $more_link_text ) { return str_replace( $more_link_text, __( 'Read more', 'iwata' ), $more_link ); } add_filter( 'the_content_more_link', 'iwata_custom_more_link', 10, 2 ); endif; /* --------------------------------------------------------------------------------------------- SET EXCERPT LENGTH --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_custom_excerpt_length' ) ) : function iwata_custom_excerpt_length( $length ) { return 33; } add_filter( 'excerpt_length', 'iwata_custom_excerpt_length', 999 ); endif; /* --------------------------------------------------------------------------------------------- SET EXCERPT SUFFIX --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_new_excerpt_more' ) ) : function iwata_new_excerpt_more( $more ) { return '...'; } add_filter( 'excerpt_more', 'iwata_new_excerpt_more' ); endif; /* --------------------------------------------------------------------------------------------- ADD POST CLASSES --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_post_classes' ) ) : function iwata_post_classes( $classes ) { // Always include the "post" class, used for styling $classes[] = 'post'; return $classes; } add_filter( 'post_class', 'iwata_post_classes' ); endif; /* --------------------------------------------------------------------------------------------- POST META FUNCTION --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_post_meta' ) ) : function iwata_post_meta() { ?>
found_posts ) { /* Translators: %s = Number of results */ $description = sprintf( _nx( 'We found %s result for your search.', 'We found %s results for your search.', $wp_query->found_posts, '%s = Number of results', 'iwata' ), $wp_query->found_posts ); } else { $description = __( 'We could not find any results for your search.', 'iwata' ); } } return $description; } add_filter( 'get_the_archive_description', 'iwata_filter_archive_description' ); endif; /* --------------------------------------------------------------------------------------------- IWATA COMMENT FUNCTION --------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'iwata_comment' ) ) : function iwata_comment( $comment, $args, $depth ) { switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => '' . __( 'Reply', 'iwata' ), ) ) ); edit_comment_link( '' . __( 'Edit', 'iwata' ), '
', '
' ); ?>