twentyfourteenのアイキャッチ画像で使われている関数のまとめ
WordPressの標準テーマのtwentyfourteenのアイキャッチ画像の設定を変更したいと思い、まずは使われている関数をまとめてみました。
アイキャッチ画像を出力
twentyfourteen_post_thumbnail();
content.phpなどのページで呼び出してアイキャッチ画像を出力。
ファイル
- wp-content/themes/twentyfourteen/inc/template-tags.php
処理で使われている関数一覧
- post_password_required
- is_attachment
- has_post_thumbnail
- is_singular
- is_active_sidebar
- is_page_template
- the_post_thumbnail
処理の流れ
新しい画像サイズの登録
add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
twentyfourteen用の画像サイズも用意されていました。
まとめ
ページやステータスの判定が主で、問題なければViewのブロックを振り分けて出力という流れでした。