Wordpress 为什么总是有人打电话给邮政局?

Wordpress 为什么总是有人打电话给邮政局?,wordpress,plugins,themes,Wordpress,Plugins,Themes,我正在开发一个wordpress主题,在我的header.php中,我相信我有有效的代码,但是由于某些原因,缩略图总是显示在下面的代码中 我试图实现的逻辑是: if this is the homepage, and the s3slider plugin has been installed show the slider else if this page has a featured image (the_post_thumbnail) show the thumbnail e

我正在开发一个wordpress主题,在我的header.php中,我相信我有有效的代码,但是由于某些原因,缩略图总是显示在下面的代码中

我试图实现的逻辑是:

if this is the homepage, and the s3slider plugin has been installed
   show the slider
else if this page has a featured image (the_post_thumbnail)
   show the thumbnail
else
   show a default image
我的代码块是:

if (is_front_page() && function_exists(s3slider_show()) ) {
//we're on the homepage, and s3Slider exists
    s3slider_show();
} elseif ( has_post_thumbnail() ) {
//there is a featured image / thumbnail
    the_post_thumbnail();
} else {
    // the current post lacks a thumbnail
    ?><img alt="alt text" src="image.jpg" />
    <?php
}
if(是否存在首页()&&function(s3slider\u show())){
//我们在主页上,并且存在一个链接
s3slider_show();
}elseif(具有\u post\u缩略图()){
//有一个特色图像/缩略图
_post_缩略图();
}否则{
//当前帖子缺少缩略图
?>
需要一个字符串:

function_exists( 's3slider_show' )

由于函数
s3slider\u show
不返回字符串,因此第一个条件的计算结果总是
false

Ahhh…我太傻了。当然,之所以显示滑块,是因为我在函数\u exists()中调用了函数。谢谢!