Php Wordpress |如何围绕regulr HTML将内容放在文章的开头和结尾?
我有一个wordpress网站,我需要把一些可更新的内容放在一篇文章中,围绕着普通的HTML,这是半自动半静态的。 代码如下:Php Wordpress |如何围绕regulr HTML将内容放在文章的开头和结尾?,php,wordpress,wordpress-theming,custom-wordpress-pages,Php,Wordpress,Wordpress Theming,Custom Wordpress Pages,我有一个wordpress网站,我需要把一些可更新的内容放在一篇文章中,围绕着普通的HTML,这是半自动半静态的。 代码如下: <img src="https://website.xyz/img.jpg" class="fullimgfirst" alt=""> <img src="https://website.xyz/img3.jpg" class="leftimg" alt
<img src="https://website.xyz/img.jpg" class="fullimgfirst" alt="">
<img src="https://website.xyz/img3.jpg" class="leftimg" alt="">
<img src="https://website.xyz/img4.jpg" class="rightimg" alt="">
<img src="https://website.xyz/img5.jpg" class="fullimg" alt="">
<div class="firstfull">
<div class="firstleft">
<p1>Branding + Digital</p1>
</div>
<div class="firstright">
<h1>Summit</h1>
</div>
</div>
<div class="secondfull">
<h2>Project overview</h2>
<p2>The project description.</p2>
</div>
<img src="https://website.xyz/img2.jpg" class="bigimg" alt="">
<img src="https://website.xyz/img3.jpg" class="leftimg" alt="">
<img src="https://website.xyz/img4.jpg" class="rightimg" alt="">
<img src="https://website.xyz/img10.jpg" class="fullimglast" alt="">
品牌+数字
首脑会议
项目概述
项目描述。
用户只需更新所有图像和P2。但正如你所看到的,第一行和最后一行都有图像。如何在wordpress中保持此部件静止:
<div class="firstfull">
<div class="firstleft">
<p1>Branding + Digital</p1>
</div>
<div class="firstright">
<h1>Summit</h1>
</div>
</div>
<div class="secondfull">
<h2>Project overview</h2>
品牌+数字
首脑会议
项目概述
每个帖子的图片和P2可上传/更新
非常感谢您。您可以使用ACF插件 为此,您必须为顶部和底部图像创建两个ACF Repeater字段。并根据您的结构调用模板中的ACF字段 P2将来自管理页面编辑器() 您可以这样编写代码:
<?php if( have_rows('top_content_images') ): ?>
<?php while( have_rows('top_content_images') ): the_row();
$top_image = get_sub_field('content_image');
?>
<?php echo wp_get_attachment_image( $top_image, 'full' ); ?>
<?php endwhile; ?>
<?php endif; ?>
<div class="firstfull">
<div class="firstleft">
<p1>Branding + Digital</p1>
</div>
<div class="firstright">
<h1>Summit</h1>
</div>
</div>
<div class="secondfull">
<h2>Project overview</h2>
<?php the_content();?>
</div>
<?php if( have_rows('bottom_content_images') ): ?>
<?php while( have_rows('bottom_content_images') ): the_row();
$bottom_image = get_sub_field('content_image');
?>
<?php echo wp_get_attachment_image( $bottom_image, 'full' ); ?>
<?php endwhile; ?>
<?php endif; ?>
品牌+数字
首脑会议
项目概述