テーマ Celestial – Lite が洋物の場合
アルファベットの表記を想定しているためか
日本語にすると、テキストの文字が小さく感じてしまう
更に色がグレーなので見にくかった
これをカスタマイズしたいと思ったのですが
Font の変更
ネットで調べて、
スタイルシート style.css
body にある font: 16px に設定
ところが、これを変えても変化なし
あるいは直ぐには反映されていない
ブラウザのキャッシュをクリアしても変化なし
1 2 3 4 5 6 7 8 |
body { font-family: Helvetica, Arial, sans-serif; line-height: 1; -ms-word-wrap: break-word; word-wrap: break-word; font-size: 16px; color: #000000; } |
スタイルシートをいろいろ調べてみると
他の設定があり、これを修正したところ
うまくいきました。
1 2 3 4 5 6 7 8 9 10 |
#st-content-wrapper { min-height: 10rem; margin: 0; padding: 0 0 60px; font-size: 16px; font-size: 1.000rem; line-height: 22px; line-height: 1.375rem; color: #000000; } |
色は、外観 -> カスタマイズ -> 色で
Content Text Color の変更で
こちらは直ぐに反映された
テーマによっては設定が無い場合もあるようです
更新日の追加
Celestial – Lite は気に入っているのですが
更新日の表示がページの末尾になってしまっている
作成日よりも更新日が重要な場合
これはちょっと困るのです
こちらに更新日の表示について記述がありましたので
これを使ってみます
テーマのための関数 (functions.php)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
... /** get_the_modified_time()の結果がget_the_time()より古い場合はget_the_time()を返す。 同じ場合はnullをかえす。 それ以外はget_the_modified_time()をかえす。 */ function get_mtime($format) { $mtime = get_the_modified_time('Ymd'); $ptime = get_the_time('Ymd'); if ($ptime > $mtime) { return get_the_time($format); } elseif ($ptime === $mtime) { return null; } else { return get_the_modified_time($format); } } |
単一記事の投稿 (single.php)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
.... <?php else : // If the left sidebar is not selected - use this layout ?> <section id="primary" class="site-content span8"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php if ($mtime = get_mtime('Y/m/d')) echo 'UpDate: ', $mtime; ?> <?php $test = "\n\n"; echo nl2br($test); ?> <?php get_template_part( '/partials/content', 'single' ); ?> <div class="navigation"> <div class="previous"><?php previous_post_link( '‹ %link' ); ?></div> <div class="next"><?php next_post_link( '%link ›' ); ?></div> </div><!-- .navigation --> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar(); ?> <?php endif; ?> |
nl2br は改行
に変換する関数で
タイトルとの間にスペースを入れました