window.arkheTheme = 1;' . PHP_EOL; } ); /** * 抜粋文字数を変更する */ add_filter( 'excerpt_length', '\Arkhe_Theme\hook_excerpt_length' ); add_filter( 'excerpt_mblength', '\Arkhe_Theme\hook_excerpt_length' ); function hook_excerpt_length( $length ) { if ( is_admin() ) return $length; if ( defined( 'ARKHE_EXCERPT_LENGTH' ) ) { return ARKHE_EXCERPT_LENGTH; } return $length; } /** * 抜粋文の末尾を ... に */ add_filter( 'excerpt_more', '\Arkhe_Theme\hook_excerpt_more' ); function hook_excerpt_more( $more ) { if ( is_admin() ) return $more; return '…'; } /** * Feedlyでアイキャッチ画像を取得できるようにする */ add_filter( 'the_excerpt_rss', '\Arkhe_Theme\add_rss_thumb' ); add_filter( 'the_content_feed', '\Arkhe_Theme\add_rss_thumb' ); function add_rss_thumb( $content ) { global $post; $thumb = get_the_post_thumbnail_url( $post->ID, 'large' ); if ( $thumb ) { $content = '

' . $content; } return $content; } /** * Add skip link */ add_action( 'wp_body_open', '\Arkhe_Theme\hook_wp_body_open', 5 ); function hook_wp_body_open( $output ) { echo ''; } /** * カテゴリーリストの件数をの中に移動 & spanで囲む */ add_action( 'wp_list_categories', '\Arkhe_Theme\hook_wp_list_categories' ); function hook_wp_list_categories( $output ) { $output = str_replace( ' (', '(', $output ); $output = str_replace( ')', ')', $output ); // サブメニューがある場合(