道歉,我相對較新的PHP和我正在學習,但我堅持這一點...我有這個模板的頁面標題部分與背景圖像。我可以添加背景圖片,但是如果在頁面上沒有選擇background-img:url,有沒有辦法在默認的background-img:url中寫入這個模板?PHP的wordpress模板 - 添加默認圖像,如果沒有選擇
<section class="page-title" <?php if($bg):?>style="background-image:url('<?php echo esc_url($bg);?>');"<?php endif;?>>
<div class="auto-container">
<h1><?php if($title) echo balanceTags($title); else wp_title('');?></h1>
<div class="bread-crumb">
<?php echo convo_get_the_breadcrumb();?>
</div>
</div>
非常棒@psdev,謝謝!!! –