is_home()

Sponsored Link

メインブログのージが表示されている場合です。これは、サイトコンテンツのブログの時間を基づいて表示しているページです。もしフロントページ(下記参照)の静的ページを設定している場合は、管理画面>設定>表示設定内の”フロントページの表示”として設定しているページがTrueの場合のみです。

原文(翻訳元)When the main blog page is being displayed. This is the page which is showing the time based blog content of your site, so if you’ve set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the “Posts page” in Administration > Settings > Reading.

作業例

その他の例では、ループに条件タグを使用する方法です。これがシングル投稿、カテゴリー、ホームとページで表示する固定のアーカイブの時、index.php内で、コンテンツあるいは抜粋を表示する選択をします。

原文(翻訳元)Other example how to use Conditional Tags into loop. choose display content or excerpt in the index.php, when this is unique archive for display single post, categories, home and page.

if (is_home() || is_single()) {
   the_content();
}
else {
   the_excerpt();
}

ホームページではない場所に、コードまたは要素を表示する必要がある場合です。

原文(翻訳元)When you need display a code or element, in a place that is not the home page.

<?php if (!is_home()) {?>

 Insert your code...

<?php }?>

is_sticky

この条件タグは”フロントページへこの投稿を固定する”チェックボックス現在の投稿にチェックされている場合にチェックします。これはTRUEまたはFALSEのいずれかを返すという意味のプール関数です。

Continue reading

is_page

この条件タグは、ページが表示されている場合にチェックします。これは、プール関数で、TRUE か FALSEのいずれかを返すという意味です。このタグは、ループ前に使用する必要があり、ループ内では動作しません(以下の注を参照)。

Continue reading

is_page_template()

テンプレートページが使われている場合

バージョン2.5以降では、ページテンプレート内出ないにしろ、もし特定のページテンプレートが使用されていた場合にしろ、決定するために判断します。

原文(翻訳元)Beginning with Version 2.5 this allows you to determine whether or not you are in a page template or if a specific page template is being used.

ページテンプレートが使われていますか?

Continue reading

Sponsored Link