functions.phpに以下を記述
[php]if ( ! function_exists( 'post_is_in_descendant_category' ) ) {
function post_is_in_descendant_category( $cats, $_post = null ) {
foreach ( (array) $cats as $c…
現在のテンプレートファイル名の拡張子を除いた名前をbodyのidに設定したかったので、テンプレートファイル名を取得する方法を調べました。
WordPressのトップページとカテゴリページでデザインを変えたい場合などに役立つかと思います。
global $template; $template_file_name = basename($template, '.php');
graffiti on the web
この投稿へのコメント
コメントはまだありません。