Last active
January 3, 2016 13:09
-
-
Save kohki-shikata/8467447 to your computer and use it in GitHub Desktop.
**For concrete5Add custom css file in the specified page type.Required css file same named as page type handle, in the template directory.
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
<?php | |
$pageType = $c->getCollectionTypeHandle();//ページタイプのハンドルを取得 | |
$pageTypeCss = $this->getThemePath() . "/css/" . $pageType . ".css";//そのハンドルの名前を使ったcssがあるとすると | |
$checkExists = file_exists($pageTypeCss);//そもそもそのcssファイルが存在するか | |
if(!$checkExists):?> | |
<link rel="stylesheet" href="<?php echo $pageTypeCss;?>"> | |
<?php endif; // あるならlinkタグで出力。ないならそのまま ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet must be written in header.php