get_post_type() – WordPress テンプレートタグのリファレンス
条件タグでないが、現在の投稿の登録された投稿タイプを返します。
Not really a conditional tag, but returns the registered post type of the current post.
if( get_post_type() == ‘book’ ) …
現在の投稿が’book’タイプの場合、確認をテストします。
Tests to see if the current post is of type ‘book’.
post_type_exists()
投稿タイプが与えられ、投稿タイプを登録された場合、trueを返します。これは投稿が特定のpost_typeの場合、テストしていません。注:この関数は、3.0の開発で簡単に存在しているis_post_type関数に置き換えられます。
Returns true if a given post type is a registered post type. This does not test if a post is a certain post_type. Note: This function replaces a function called is_post_type which existed briefly in 3.0 development.
HOME » WordPressの条件タグ » get_post_type()
Page 1 of 11
ツイート
get_post_type() http://f.ast.ly/kKHxC