__( 'Header Menu', 'tijaji' ), 'footer-menu' => __( 'Footer Menu', 'tijaji' ), ) ); } add_theme_support( 'menus' ); $tijaji_args = array( 'default' => get_template_directory_uri() . '/images/default-1.jpg', 'width' => 1920, 'height' => 600, 'uploads' => true, 'header-text' => false, 'default-text-color' => '000000', 'video' => true, ); add_theme_support( 'custom-header', $tijaji_args ); register_default_headers( array( 'default-image' => array( 'url' => get_template_directory_uri() . '/images/default-1.jpg', 'thumbnail_url' => get_template_directory_uri() . '/images/default-1.jpg', ), 'default-image_2' => array( 'url' => get_template_directory_uri() . '/images/default-2.jpg', 'thumbnail_url' => get_template_directory_uri() . '/images/default-2.jpg', ), 'default-image_3' => array( 'url' => get_template_directory_uri() . '/images/default-3.jpg', 'thumbnail_url' => get_template_directory_uri() . '/images/default-3.jpg', ), ) ); add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 100, 'flex-width' => true, ) ); $tijaji_background_param = array( 'default-color' => 'f9f9f9' ); add_theme_support( 'custom-background', $tijaji_background_param ); } add_action( 'after_setup_theme', 'tijaji_theme_support' ); function tijaji_remove_tagline($tijaji_title) { if ( isset($tijaji_title['tagline']) ) { unset( $tijaji_title['tagline'] ); } return $tijaji_title; } add_filter( 'document_title_parts', 'tijaji_remove_tagline' ); function tijaji_title_separator($tijaji_sep) { $tijaji_sep = '|'; return $tijaji_sep; } add_filter( 'document_title_separator', 'tijaji_title_separator' ); function tijaji_widgets_init() { register_sidebar(array( 'name' => __( 'Sidebar', 'tijaji' ), 'id' => 'sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __( 'Footer', 'tijaji' ), 'id' => 'footer', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __( 'Content top', 'tijaji' ), 'id' => 'content_top', 'description' => __( 'Ideal for displaying bread crumbs.', 'tijaji' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __( 'Article Content bottom', 'tijaji' ), 'id' => 'content_bottom', 'description' => __( 'It is displayed directly under the article.', 'tijaji' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init','tijaji_widgets_init' ); if ( !function_exists( 'tijaji_excerpt_length' ) ) { function tijaji_excerpt_length( ) { if ( is_admin() ) { return; } return 180; } } add_filter( 'excerpt_length', 'tijaji_excerpt_length', 999 ); function tijaji_page_navi() { $pagination = get_the_posts_pagination( array( 'mid_size' => 2 ) ); $pagination = str_replace(' role="navigation"', '', $pagination); $allowed_html = array( 'a' => array( 'href' => array (), 'class' => array (), 'target' => array() ), 'div' => array( 'style' => array (), 'class' => array (), 'align' => array () ), 'span' => array( 'style' => array (), 'class' => array (), 'aria-current' => array () ), 'h2' => array( 'style' => array (), 'class' => array () ), 'nav' => array( 'style' => array (), 'class' => array (), 'align' => array () ), ); echo wp_kses( $pagination, $allowed_html ); } require get_template_directory() . '/inc/header-images.php'; require get_template_directory() . '/inc/customizer.php'; require get_template_directory() . '/inc/customizer-sidebar.php'; require get_template_directory() . '/inc/theme-info.php'; if( tijaji_layout() == 'one' ) { if ( ! isset( $content_width ) ) $content_width = 955; }else{ if( tijaji_max_content_width() == 'width800' ) { if ( ! isset( $content_width ) ) $content_width = '446'; } if( tijaji_max_content_width() == 'width850' ) { if ( ! isset( $content_width ) ) $content_width = '492'; } if( tijaji_max_content_width() == 'width900' ) { if ( ! isset( $content_width ) ) $content_width = '538'; } if( tijaji_max_content_width() == 'width950' ) { if ( ! isset( $content_width ) ) $content_width = '584'; } if( tijaji_max_content_width() == 'width1000' ) { if ( ! isset( $content_width ) ) $content_width = '630'; } if( tijaji_max_content_width() == 'width1050' ) { if ( ! isset( $content_width ) ) $content_width = '676'; } if( tijaji_max_content_width() == 'width1100' ) { if ( ! isset( $content_width ) ) $content_width = '722'; } if( tijaji_max_content_width() == 'width1150' ) { if ( ! isset( $content_width ) ) $content_width = '768'; } if( tijaji_max_content_width() == 'width1200' ) { if ( ! isset( $content_width ) ) $content_width = '814'; } if( tijaji_max_content_width() == 'width1250' ) { if ( ! isset( $content_width ) ) $content_width = '860'; } if( tijaji_max_content_width() == 'width1300' ) { if ( ! isset( $content_width ) ) $content_width = '906'; } if( tijaji_max_content_width() == 'width1350' ) { if ( ! isset( $content_width ) ) $content_width = '952'; } if( tijaji_max_content_width() == 'width1400' ) { if ( ! isset( $content_width ) ) $content_width = '998'; } if( tijaji_max_content_width() == 'widthfull' ) { if ( ! isset( $content_width ) ) $content_width = '998'; } } function tijaji_category_id_class($tijaji_classes) { global $post; if( !is_search() && !is_404() ) { foreach((get_the_category($post->ID)) as $category) $tijaji_classes [] = 'cat-' . $category->cat_ID . '-id'; } return $tijaji_classes; } add_filter('post_class', 'tijaji_category_id_class'); add_filter('body_class', 'tijaji_category_id_class'); remove_filter('pre_user_description', 'wp_filter_kses'); add_filter('pre_user_description', 'wp_filter_post_kses'); function tijaji_has_thumb_class($tijaji_classes) { global $post; if( has_post_thumbnail($post->ID) ) { $tijaji_classes[] = 'has_thumb'; } return $tijaji_classes; } add_filter('post_class', 'tijaji_has_thumb_class'); function tijaji_custom_comments_list($tijaji_comment, $tijaji_args, $tijaji_depth){ ?>
  • id="li-comment-">
    ', '' ); ?>
    comment_approved == '0') echo '

    ' . esc_html_e('Your comment is awaiting approval.','tijaji') . '

    ';?>
    $tijaji_depth, 'reply_text' => __( 'Reply', 'tijaji' ), 'before' => '', 'after' => '') ) ); ?>
  • id="li-comment-">
    ', '' ); ?>
    ') ) { $tijaji_track_con = str_replace( array("\r\n","\n","\r"), '', get_comment_text() ); preg_match('|(.*?)|s', $tijaji_track_con , $tijaji_gettrck_t ); ?>
    '; } add_filter( 'wp_list_categories', 'tijaji_list_categories', 10, 2 ); function tijaji_list_categories( $tijaji_linkindata ) { $tijaji_linkindata = preg_replace('/<\/a>\s*\((\d+)\)/',' ($1)',$tijaji_linkindata); return $tijaji_linkindata; } add_filter( 'get_archives_link', 'tijaji_archives_link' ); function tijaji_archives_link( $tijaji_linkindata ) { $tijaji_linkindata = preg_replace('/<\/a>\s*( )\((\d+)\)/',' ($2)',$tijaji_linkindata); return $tijaji_linkindata; } function tijaji_editor_style(){ add_editor_style(); } add_action('after_setup_theme', 'tijaji_editor_style'); if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'tijaji_Custom_Content' ) ) : class tijaji_Custom_Content extends WP_Customize_Control { public $content = ''; public function render_content() { $allowed_html = array( 'a' => array( 'href' => array (), 'onclick' => array (), 'target' => array(), 'class' => array () ), 'div' => array( 'style' => array (), 'class' => array (), 'align' => array () ), 'p' => array( 'style' => array (), 'class' => array (), 'align' => array () ), 'span' => array( 'style' => array (), 'class' => array (), 'align' => array () ), 'br' => array( 'style' => array (), 'class' => array (), 'align' => array () ), 'h2' => array( 'style' => array (), 'class' => array (), 'align' => array () ), 'h3' => array( 'style' => array (), 'class' => array (), 'align' => array () ), ); if ( isset( $this->content ) ) { echo wp_kses( $this->content , $allowed_html ); } } } endif; function tijaji_user_info_add( $userinfoadd ) { $userinfoadd['twitter'] = __( 'Twitter URL','tijaji' ); $userinfoadd['facebook'] = __( 'Facebook URL','tijaji' ); $userinfoadd['googleplus'] = __( 'Google+ URL','tijaji' ); $userinfoadd['instagram'] = __( 'Instagram URL','tijaji' ); return $userinfoadd; } add_filter('user_contactmethods','tijaji_user_info_add'); function tijaji_thumbnail( $content ){ if( is_singular() ) { $pattern = '/]+?)\/?>/i'; $replacement = ''; $content = preg_replace($pattern, $replacement, $content); } return $content; } add_filter( 'post_thumbnail_html', 'tijaji_thumbnail'); function tijaji_archive_title( $title ){ if ( is_category() ) { /* translators: %s: category term */ $title = sprintf( esc_html__( 'Category Archives: %s','tijaji' ), single_cat_title( '', false ) ); } elseif ( is_tag() ) { /* translators: %s: tag term */ $title = sprintf( esc_html__( 'Tag Archives: %s','tijaji' ) , '' . single_tag_title( '', false ) . '' ); } elseif ( is_author() ) { $title = '' . get_the_author() . '' ; } return $title; } add_filter( 'get_the_archive_title', 'tijaji_archive_title' ); include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); require_once( ABSPATH . 'wp-admin/includes/file.php' ); function tijati_minify($str){ $str = preg_replace('|/\*(.*?)\*/|s', '', $str); $str = str_replace(array("\r","\n"), '', $str); $str = preg_replace('`([^*/])\/\*([^*]|[*](?!/)){5,}\*\/([^*/])`Us', '$1$3', $str); $str = preg_replace('`\s*({|}|,|:|;)\s*`', '$1', $str); $str = str_replace(';}', '}', $str); $str = preg_replace('`(?=|})[^{}]+{}`', '', $str); $str = preg_replace('`[\s]+`', ' ', $str); return $str; } function tijaji_mynify_css(){ $origin_file = get_template_directory() . '/style.css'; $minify_file = get_template_directory() . '/style.min.css'; $origin_file_uri = get_template_directory_uri() . '/style.css'; $minify_file_uri = get_template_directory_uri() . '/style.min.css'; $css = ''; $origin_file_date = ''; $minify_file_date = ''; $flag = false; $child_origin_file = get_stylesheet_directory() . '/style.css'; $child_minify_file = get_stylesheet_directory() . '/style.min.css'; $child_origin_file_uri = get_stylesheet_directory_uri() . '/style.css'; $child_minify_file_uri = get_stylesheet_directory_uri() . '/style.min.css'; $child_css = ''; $child_origin_file_date = ''; $child_minify_file_date = ''; $child_flag = false; if( tijaji_footerwidget() == '2') $fwcss = get_template_directory() . '/css/fw2.css'; if( tijaji_footerwidget() == '3') $fwcss = get_template_directory() . '/css/fw3.css'; if( tijaji_footerwidget() == '4') $fwcss = get_template_directory() . '/css/fw4.css'; if( tijaji_footerwidget() == '5') $fwcss = get_template_directory() . '/css/fw5.css'; if( WP_Filesystem() ){ global $wp_filesystem; if ( !file_exists($minify_file) ){ $wp_filesystem->touch($minify_file); $flag = 1; } $origin_file_date = filemtime($origin_file); $minify_file_date = filemtime($minify_file); if( $minify_file_date < $origin_file_date){ $flag = 1; } if( $flag == 1 ){ $css = $wp_filesystem->get_contents($origin_file); $css = tijati_minify( $css ); $fwcss = $wp_filesystem->get_contents($fwcss); $fwcss = tijati_minify( $fwcss ); $wp_filesystem->put_contents($minify_file, $css . $fwcss); } if( file_exists($minify_file) ){ $file = $minify_file_uri; } else { $file = $origin_file_uri; } if( $origin_file != $child_origin_file ){ if ( !file_exists($child_minify_file) ){ $wp_filesystem->touch($child_minify_file); $flag = 1; } $child_origin_file_date = filemtime($child_origin_file); $child_minify_file_date = filemtime($child_minify_file); if( $child_minify_file_date < $child_origin_file_date){ $flag = 1; } if( $flag == 1 ){ $child_css = $wp_filesystem->get_contents($child_origin_file); $child_css = tijati_minify($child_css); $wp_filesystem->put_contents($child_minify_file, $child_css); } if( file_exists($child_minify_file) ){ $child_file = $child_minify_file_uri; } else { $child_file = $child_origin_file_uri; } } } wp_enqueue_style( 'tijaji-minify-style', $file ); if( $origin_file != $child_origin_file ) wp_enqueue_style( 'tijaji-child-minify-style', $child_file ); } function tijaji_minfy_style() { tijaji_mynify_css(); } add_action( 'wp_enqueue_scripts', 'tijaji_minfy_style' ); function tijaji_scripts() { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'tijaji_script_up', get_template_directory_uri() . '/js/up.js' ); if ( is_singular() ) wp_enqueue_script('comment-reply'); if( is_plugin_active( 'woocommerce/woocommerce.php' ) ) wp_enqueue_style( 'tijaji_wc', get_template_directory_uri() . '/css/tijaji_wc.css' ); if ( tijaji_fontfamily() == 1 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_1', 'https://fonts.googleapis.com/earlyaccess/notosansjp.css' ); if ( tijaji_fontfamily() == 2 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_2', 'https://fonts.googleapis.com/earlyaccess/notosansjapanese.css' ); if ( tijaji_fontfamily() == 3 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_3', 'https://fonts.googleapis.com/earlyaccess/mplus1p.css' ); if ( tijaji_fontfamily() == 4 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_4', 'https://fonts.googleapis.com/earlyaccess/roundedmplus1c.css' ); if ( tijaji_fontfamily() == 5 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_5', 'https://fonts.googleapis.com/earlyaccess/hannari.css' ); if ( tijaji_fontfamily() == 6 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_6', 'https://fonts.googleapis.com/earlyaccess/kokoro.css' ); if ( tijaji_fontfamily() == 7 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_7', 'https://fonts.googleapis.com/earlyaccess/nikukyu.css' ); if ( tijaji_fontfamily() == 8 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_8', 'https://fonts.googleapis.com/earlyaccess/nicomoji.css' ); if ( tijaji_fontfamily() == 9 || isset( $_GET['customize_changeset_uuid'] )) wp_enqueue_style( 'tijaji_googlefont_9', 'https://fonts.googleapis.com/earlyaccess/sawarabigothic.css' ); if ( tijaji_fontfamily() == 10 || isset( $_GET['customize_changeset_uuid'] ) ) wp_enqueue_style( 'tijaji_googlefont_10', 'https://fonts.googleapis.com/earlyaccess/sawarabimincho.css' ); wp_enqueue_style('dashicons'); } add_action( 'wp_enqueue_scripts', 'tijaji_scripts' ); function tijaji_inline_css(){ $firstveiw = get_template_directory() . '/css/firstveiw.css'; if( tijaji_slider_number() == '2') $slidercss = get_template_directory() . '/css/slider2.css'; if( tijaji_slider_number() == '3') $slidercss = get_template_directory() . '/css/slider3.css'; if( tijaji_slider_number() == '4') $slidercss = get_template_directory() . '/css/slider4.css'; if( tijaji_slider_number() == '5') $slidercss = get_template_directory() . '/css/slider5.css'; if( tijaji_sp_headermenu() == '1') $sp_menu_css = get_template_directory() . '/css/sp_menu_pc.css'; if( tijaji_sp_headermenu() == '2') $sp_menu_css = get_template_directory() . '/css/sp_menu_block.css'; if( tijaji_sp_headermenu() == '3') $sp_menu_css = get_template_directory() . '/css/sp_menu_fixed.css'; if( WP_Filesystem() ){ global $wp_filesystem; $firstcss = $wp_filesystem->get_contents($firstveiw); $firstcss = tijati_minify($firstcss); $scss = $wp_filesystem->get_contents($slidercss); $scss = tijati_minify($scss); $spmcss = $wp_filesystem->get_contents($sp_menu_css); $spmcss = tijati_minify($spmcss); echo wp_kses_post( $firstcss . $spmcss . $scss ); } } add_action( 'wp_head', 'tijaji_inline_css' ,35 ); function tijaji_inline_css_header(){ echo '' . "\n"; } add_action( 'wp_head', 'tijaji_inline_css_footer' ,40 ); function tijaji_admin_customizer_scripts() { wp_enqueue_style( 'tijaji_admin_customizer_style', get_template_directory_uri() . '/css/tijaji_admin_customizer.css' ); } add_action( 'customize_controls_enqueue_scripts', 'tijaji_admin_customizer_scripts' ); function tijaji_admin_style() { ?> |' ), array( ' ','','', '>' ), $tag ); return $tag; } add_filter('style_loader_tag','tijaji_remove_style_type'); function tijaji_remove_recentcomments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action( 'widgets_init', 'tijaji_remove_recentcomments_style' ); function tijaji_disable_emojis() { remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); } add_action( 'init', 'tijaji_disable_emojis' ); function disable_emojis_tinymce( $plugins ) { return array_diff( $plugins, array( 'wpemoji' ) ); } delete_option( 'preloadcss' ); function tijaji_style_async($html, $handle){ if( is_admin() || isset( $_GET['customize_changeset_uuid'] ) ) { return $html; } preg_match("|href='(.*?)\?|s", $html, $url); if( $url[1] ) { if( !strstr( get_option( 'preloadcss' , '' ) , $url[1] ) ) update_option( 'preloadcss', get_option( 'preloadcss' ) . ',\'' . $url[1] . '\'' ); } $htmls = str_replace(">\n" ,'>', $html . '' ); return '