Last active
July 13, 2016 04:43
-
-
Save mypacecreator/a584de191468508ee536 to your computer and use it in GitHub Desktop.
single.phpで、カテゴリースラッグを元にタイトル画像を表示する(子カテゴリーの場合も、自カテゴリーの画像を使う)
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
<h1><img src="<?php echo get_template_directory_uri(); ?>/images/title_<?php | |
$cat = get_the_category(); | |
$cat = $cat[0]; {echo $cat->category_nicename;} | |
?>.jpg" alt="<?php echo $cat->cat_name; ?>" /></h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment