comments_open

Sponsored Link

コメントがWordPressのループ内で処理された現在の投稿を許可する場合です。

comments_open »

has_tag()

現在の投稿タグの場合です。ループ内で使用しなければなりません。注:has_tagは、バージョン2.6から追加されました。

has_tag() »

is_tax()

全てのタクソノミーアーカイブページが表示されている場合です。

is_tax() »

pings_open

ピングがWordPressのループ内で処理された現在の投稿を許可する場合です。

pings_open »

in_the_loop()

“ループ内”にあるかどうかを確認します。プラグイン作者の役立ち、この条件はループ内にある時にtrueとして返します。

in_the_loop() »

is_active_sidebar()

指定されたサイドバーがアクティブ(使用中)であるかどうかを確認します。サイドバー(名前、id、ナンバーによて識別された)が使用された場合trueを返し、それ以外の関数はfalseを返します。この条件機能は、バージョン2.8から利用可能になりました。

is_active_sidebar() »

is_home()

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