Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php wordpress-如果bbpress显示内容()_Php_Wordpress - Fatal编程技术网

Php wordpress-如果bbpress显示内容()

Php wordpress-如果bbpress显示内容(),php,wordpress,Php,Wordpress,以下是我在wordpress中如何称呼我的内容: <?php if ( is_singular() ) { the_content(); } else { the_excerpt(); } ?> 我知道上面的代码是错误的,这就是为什么我要问这个问题!:) 任何帮助都将不胜感激。我在这里找到: <?php if ( is_singular() ) { the_content(); } elseif ( is

以下是我在wordpress中如何称呼我的内容:

<?php
    if ( is_singular() ) {
    the_content();
    } else {
    the_excerpt();
    }
?>
我知道上面的代码是错误的,这就是为什么我要问这个问题!:)

任何帮助都将不胜感激。

我在这里找到:

<?php
    if ( is_singular() ) {
    the_content();
    }
    elseif ( is_bbpress() ) {
    the_content();
    }
    else {
    the_excerpt();
    }
?>

这就是你要找的吗

<?php if ( is_singular() || is_bbPress() ) {
         the_content();
      } else {
         the_excerpt();
} ?>

<?php if ( is_singular() || is_bbPress() ) {
         the_content();
      } else {
         the_excerpt();
} ?>