'', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', )); function basic_auth($auth_list,$realm="Restricted Area",$failed_text="認証に失敗しました"){ if (isset($_SERVER['PHP_AUTH_USER']) and isset($auth_list[$_SERVER['PHP_AUTH_USER']])){ if ($auth_list[$_SERVER['PHP_AUTH_USER']] == $_SERVER['PHP_AUTH_PW']){ return $_SERVER['PHP_AUTH_USER']; } } header('WWW-Authenticate: Basic realm="'.$realm.'"'); header('HTTP/1.0 401 Unauthorized'); header('Content-type: text/html; charset='.mb_internal_encoding()); die($failed_text); } //パンクズ function breadcrumb($divOption = array("id" => "breadcrumb", "class" => "pan")){ global $post; $str =''; if(!is_home()&&!is_admin()){ /* !is_admin は管理ページ以外という条件分岐 */ $tagAttribute = ''; foreach($divOption as $attrName => $attrValue){ $tagAttribute .= sprintf(' %s="%s"', $attrName, $attrValue); } $str.= ''; $str.= ''; $str.=''; } echo $str; } //WordPressのバージョン情報の出力を停止 remove_action('wp_head','wp_generator'); // 管理バーの表示のチェックをデフォルトで消す add_filter( 'show_admin_bar', '__return_false' ); //jQueryの設定を出力 add_action('wp_head', 'myScript', 1); function myScript() { wp_enqueue_script('jquery'); } //画像サイズ add_image_size('main',194,9999,false); add_image_size('sub',225,9999,false); add_image_size('large',640,640,false); add_image_size('top',310,310,array( 'left', 'top')); //アイキャッチ表示 add_theme_support('post-thumbnails'); add_image_size('thumb190', 190, 190, true); add_image_size('thumb98', 98, 98, true); add_image_size('thumb30', 100, 100, true); //投稿文字数 function new_excerpt_mblength($length) { return 50; } add_filter('excerpt_mblength', 'new_excerpt_mblength'); //文末の文字を変更 […]←を変更 function new_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'new_excerpt_more'); //メール確認用 add_filter( 'wpcf7_validate_email', 'wpcf7_text_validation_filter_extend', 11, 2 ); add_filter( 'wpcf7_validate_email*', 'wpcf7_text_validation_filter_extend', 11, 2 ); function wpcf7_text_validation_filter_extend( $result, $tag ) { global $my_email_confirm; $tag = new WPCF7_Shortcode( $tag ); $name = $tag->name; $value = isset( $_POST[$name] ) ? trim( wp_unslash( strtr( (string) $_POST[$name], "\n", " " ) ) ) : ''; if ($name == "your-email"){ $my_email_confirm=$value; } if ($name == "your-email_confirm" && $my_email_confirm != $value){ $result->invalidate( $tag,"確認用のメールアドレスが一致していません"); } return $result; } //ビジュアルエディタ add_editor_style(); function form_name($name) { return 'お名前
name'; } add_filter('booking_form_name', 'form_name'); function post_is_in_descendant_category( $cats, $_post = null ) { foreach ( (array) $cats as $cat ) { // get_term_children() accepts integer ID only $descendants = get_term_children( (int) $cat, 'category'); if ( $descendants && in_category( $descendants, $_post ) ) return true; } return false; } ?>