Created
June 3, 2012 19:54
-
-
Save miya0001/2864806 to your computer and use it in GitHub Desktop.
リバースプロキシやCDN,キャッシュ系のプラグインと仲良しで子テーマにも対応しやすいCSSの読み込み方
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
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/style.css?ver=<?php echo filemtime(get_template_directory().'/style.css'); ?>" /> | |
<?php if (is_child_theme()): ?> | |
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css?ver=<?php echo filemtime(get_stylesheet_directory().'/style.css') ?>" /> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
自作テーマを作るときに親テーマにこんな風に書いておけば、子テーマサイドにはstyle.cssを置くだけでいいし、@importを使うよりも表示速度がやや高速化できる。