'f1f1f1')); register_nav_menu( 'header-nav', __('Header Navi','mind') ); register_nav_menu( 'footer-nav', __('Footer Navi','mind') ); } function mind_add_scripts() { wp_enqueue_script( 'load-js', get_template_directory_uri() . '/assets/js/mind.js', "", '20190515' ); wp_enqueue_style( 'style', get_stylesheet_uri() ); } add_action('wp_enqueue_scripts', 'mind_add_scripts'); // Header Area Manage Function function mind_customize_register( $wp_customize ) { $wp_customize->add_section( 'custom_banner_setup', array( 'title' => __('Induction Area','mind'), 'priority' => 70, )); // Induction Area1 $wp_customize->add_setting( 'mind_theme_options1[originPage]', array( 'default' => '', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'mind_theme_options_page1', array( 'settings' => 'mind_theme_options1[originPage]', 'label' => __('Induction Banner1','mind'), 'description' => __('You can select the fixed page you want to display in the guidance area of the top page.','mind'), 'section' => 'custom_banner_setup', 'type' => 'dropdown-pages', )); $wp_customize->add_setting( 'mind_theme_options1[originChkbox]', array( 'default' => false, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'mind_sanitize_checkbox', )); $wp_customize->add_control( 'mind_theme_options_chkbox1', array( 'settings' => 'mind_theme_options1[originChkbox]', 'label' => __('Enable','mind'), 'section' => 'custom_banner_setup', 'type' => 'checkbox', )); // Induction Area2 $wp_customize->add_setting( 'mind_theme_options2[originPage]', array( 'default' => '', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'mind_theme_options_page2', array( 'settings' => 'mind_theme_options2[originPage]', 'label' => __('Induction Banner2','mind'), 'section' => 'custom_banner_setup', 'type' => 'dropdown-pages', )); $wp_customize->add_setting( 'mind_theme_options2[originChkbox]', array( 'default' => false, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'mind_sanitize_checkbox', )); $wp_customize->add_control( 'mind_theme_options_chkbox2', array( 'settings' => 'mind_theme_options2[originChkbox]', 'label' => __('Enable','mind'), 'section' => 'custom_banner_setup', 'type' => 'checkbox', )); // Induction Area3 $wp_customize->add_setting( 'mind_theme_options3[originPage]', array( 'default' => '', 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'mind_theme_options_page3', array( 'settings' => 'mind_theme_options3[originPage]', 'label' => __('Induction Banner3','mind'), 'section' => 'custom_banner_setup', 'type' => 'dropdown-pages', )); $wp_customize->add_setting( 'mind_theme_options3[originChkbox]', array( 'default' => false, 'type' => 'theme_mod', 'transport' => 'refresh', 'sanitize_callback' => 'mind_sanitize_checkbox', )); $wp_customize->add_control( 'mind_theme_options_chkbox3', array( 'settings' => 'mind_theme_options3[originChkbox]', 'label' => __('Enable','mind'), 'section' => 'custom_banner_setup', 'type' => 'checkbox', )); } add_action( 'customize_register', 'mind_customize_register' ); // Sanitize Function function mind_sanitize_checkbox( $input ) { if ( $input == true ) { return true; } else { return false; } } // Header Visual Function */ function mind_custom_headerimage_setup() { $args = array( 'default-text-color' => '515151', 'default-image' => '', 'height' => 250, 'width' => 960, 'max-width' => 2000, 'flex-height' => true, 'flex-width' => true, 'random-default' => false, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'mind_custom_headerimage_setup' ); // Breadcrumb Function function mind_breadcrumb(){ global $post; $str = ''; $pNum = 2; $str.= ''; $allowed_html = array( 'a' => array( 'href' => array (), 'onclick' => array (), 'target' => array(), ), 'div' => array( 'id' => array (), 'class' => array ()), 'span' => array(), 'ul' => array(), 'li' => array(), ); echo wp_kses($str, $allowed_html ); } // Copy right Manage Function function mind_theme_customize_copyright($wp_customize_copyright){ $wp_customize_copyright->add_setting( 'copyright' , array( 'default' => esc_html(bloginfo( 'name' )), 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize_copyright->add_control( 'copyright_edit', array( 'label' => __('Copy Right', 'mind'), 'section' => 'title_tagline', 'settings' => 'copyright', 'type' => 'text', 'description' => __('Please set the character string to be displayed in the copy part of the footer.','mind'), )); } add_action( 'customize_register', 'mind_theme_customize_copyright' ); // Display Copy right function mind_get_the_copyright(){ return esc_html( get_theme_mod( 'copyright' ) ); } // Change Link Color Function function mind_custom_theme_setup( $wp_customize ) { $wp_customize->add_setting( 'link_color', array( 'default' => '#2962ff', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( 'label' => __( 'Primary Color', 'mind' ), 'section' => 'colors', 'priority' => 10, ))); $czr_color_link = ".entory-content a"; } add_action( 'customize_register', 'mind_custom_theme_setup'); // Display Link Color Styles if ( get_theme_mod( 'link_color', 'default' ) !== 'default' ) { function mind_theme_link_color() { $link_color = get_theme_mod( 'link_color' ); ?>
Category: '); foreach($categories_list as $cl){ $cat_link = get_category_link($cl->cat_ID); echo '' . esc_html($cl->name) . ''; } printf( ''); } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tags(); if ( get_the_tag_list() ) { printf( 'Tag: '); foreach($tags_list as $tl){ $tag_link = get_tag_link($tl->term_id ); echo '' . esc_html($tl->name) . ''; } printf( ''); } } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; //comments_popup_link("","1コメント","%コメント"); comments_popup_link("",__('1 Comment','mind'),__('% Comments','mind')); echo ''; } edit_post_link( __('Edit','mind'), '', '' ); } endif; add_action( 'widgets_init', 'mind_theme_slug_widgets_init' ); function mind_theme_slug_widgets_init() { if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => __('Side Area','mind'), 'id' => 'sidebar1', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => __('Side Under Area','mind'), 'id' => 'sidebar2', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => __('CTA Area','mind'), 'id' => 'cta_after', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } } /* コンテンツ幅の定義 */ function mind_content_width() { $GLOBALS['content_width'] = apply_filters( 'mind_content_width', 1200 ); } add_action( 'after_setup_theme', 'mind_content_width', 0 ); function mind_theme_add_editor_styles() { add_editor_style( '/css/custom-editor-style.css' ); } add_action( 'admin_init', 'mind_theme_add_editor_styles' );