Wordpress 使用ACF的不同全屏背景
在cusotm post类型中,我有5个不同的图像,可以由高级自定义字段定义。使用以下代码,我将#内部标题的背景定义为第一个图像:Wordpress 使用ACF的不同全屏背景,wordpress,background,fullscreen,advanced-custom-fields,Wordpress,Background,Fullscreen,Advanced Custom Fields,在cusotm post类型中,我有5个不同的图像,可以由高级自定义字段定义。使用以下代码,我将#内部标题的背景定义为第一个图像: <?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' ); ?> <style> #inner-header { background-image: url('<?ph
<?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' ); ?>
<style>
#inner-header {
background-image: url('<?php echo $background[0]; ?>');
}
</style>
#内割台{
背景图像:url(“”);
}
现在,我想在我的页面中使用箭头切换我定义的不同图像的背景。请显示迄今为止执行此操作的代码。或者使用我在上面使用过的代码,因为之前我只打算使用单个背景图像。我没有比这更多的了。