所以我照你说的做了,修改了代码,并修复了我的网站,但我发现使用此布局的页面没有显示背景图像。我已经包含了名为“基本内容”的部分的全部代码,以查看您是否看到导致此问题的任何其他问题。谢谢你的帮助!
//基本内容seif(get\\u row\\u layout()==“Basic\\u content”):
$bgimage = get_sub_field(\'background_image\');
$bgcolor = get_sub_field(\'background_color\');
$maincontent = get_sub_field(\'main_content\');
$sectionid = get_sub_field(\'id\');
$newsize = get_sub_field(\'new_size\');
$textalign = get_sub_field(\'text_alignment\');
$bg = (!$bgimage == \'\') ? \'style="background-image:url("\'.$bgimage[\'url\'].\'")\' : \'\';
if($textalign == \'Left\'){ $ta = \'text-left\'; } else { $ta = \'\'; }
echo \'<div id="\'.$sectionid.\'" class="row basic \'.$newsize.\' \'.$bgcolor.\' \'.$ta.\'" \'.$bg.\'>\';
if($newsize == \'full\'){
echo $maincontent;
} elseif($newsize == \'medium\') {
echo \'<div class="container">\' .
$maincontent .
\'</div>\';
} elseif($newsize == \'small\') {
echo \'<div class="small-container">\' .
$maincontent .
\'</div>\';
} else {
echo \'<div class="small-container">\' .
$maincontent .
\'</div>\';
}
echo \'</div>\';