This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 「custom-sample.css」 は、子テーマの「sango-theme-poripu」直下にアップする */ | |
function add_custom_styles_sample() { | |
if ( is_single('sample') ) { | |
wp_enqueue_style('add_custom_styles_sample',get_stylesheet_directory_uri() . '/custom-sample.css'); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'add_custom_styles_sample' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 目次に戻るボタンの表示 */ | |
add_filter('the_content', function( $content ){ | |
if ( is_singular() && strpos( $content, ' id="ez-toc-container' ) !== false ){ | |
//挿入するHTML | |
$back_toc = '<div class="back-toc" style="font-weight:bold;font-size:15px;"><a href="#ez-toc-container"><i class="fa fa-arrow-up" aria-hidden="true"></i> 目次に戻る</a></div>'; | |
$count = 0; | |
$content = preg_replace_callback('/<h2 *[^>]*>/i', function( $m ) use (&$count, $back_toc) { | |
$count++; | |
if( $count == 1 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ヘッダーナビ */ | |
.header{ | |
box-shadow:none; | |
} | |
/* WordPressにログイン中、公開ページを見ると、画面上部に固定されるメニューの変更 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Google Analytics --> | |
<?php if ( !(is_user_logged_in()) ) : ?> | |
ここにアナリティクスのトラッキングコードを挿入 | |
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 子テーマのfunctions.php に記述 */ | |
/* 特定のカテゴリーをウィジェットのカテゴリーの一覧で非表示(子テーマのfunctions.phpに記述) */ | |
function exclude_widget_categories($args){ | |
$args['exclude'] = '27'; | |
return $args; | |
} | |
add_filter( 'widget_categories_args', 'exclude_widget_categories'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 子テーマに「admin-style.css」というファイルを新規追加 */ | |
/* WordPressの管理画面のスタイルを変更 */ | |
#wpadminbar a.ab-item{ | |
color : #23282d !important; | |
} | |
#wpadminbar a.ab-item img.avatar{ | |
display: none !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Small devices (landscape phones, 576px and up) | |
@media (min-width: 576px) { ... } | |
// Medium devices (tablets, 768px and up) | |
@media (min-width: 768px) { ... } | |
// Large devices (desktops, 992px and up) | |
@media (min-width: 992px) { ... } | |
// Extra large devices (large desktops, 1200px and up) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 特定のカテゴリの除外 | |
function exclude_category( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'cat', '-8,-9' );//マイナスをつけてカテゴリIDを除外する | |
} | |
} | |
add_action( 'pre_get_posts', 'exclude_category' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Flex */ | |
.d-flex{ | |
display : flex; | |
} | |
.d-inline-flex{ | |
display : inline-flex; | |
} | |
/* Direction */ | |
.flex-row{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
① プラグイン「Easy Table of Contents」 は入れておく | |
② ページのスクロールと連動し、今読んでいるコンテンツの見出しが画面上部に固定表示される | |
*/ | |
//上部固定の見出しラベルを作るよ | |
function kjk_fixed_headline_script() { | |
?> |
NewerOlder