Amazon.co.jp ウィジェット

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.

Tags:

HOME » WordPressの条件タグ » get_post_type()
Page 1 of 11