Wordpress网站特色图片替换问题


Wordpress Website Featured Image Replacement Issue

我在Wordpress网站上工作,页面模板在页面顶部插入"特色图像"时遇到问题。我已经隔离了控制它的PHP代码。

        $thumb = '';
        $width = (int) apply_filters('et_page_image_width',621);
        if ( is_page_template( 'page-full.php' ) || $fullwidth ) $width = (int) apply_filters('et_page_image_full_width', 960);
        $height = (int) apply_filters('et_page_image_height',320);
        $classtext = '';
        $titletext = get_the_title();
        $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Pageimage');
        $thumb = $thumbnail["thumb"];

现在,如果我删除此代码,它将删除页面顶部的图像,这很好,但我想用媒体库中的图像替换它。是否可以更改代码,使其从Wordpress页面编辑器的"编辑页面>自定义字段"部分提取图像?

谢谢你的帮助。

添加以下内容:

if ($thumb) { echo $thumb;} else { echo 'some other image here';}

用新的查询替换"此处的其他图像",以获得替代图像。

希望这能有所帮助?