Skip to content

Instantly share code, notes, and snippets.

@mypacecreator
Last active Dec 28, 2015
Embed
What would you like to do?
ページスラッグを元にタイトル画像を表示する(子カテゴリーでもそのページのスラッグを取る)
<h1><img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/title_<?php echo esc_attr( $post->post_name ); ?>.jpg" alt="<?php the_title_attribute(); ?>" /></h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment