gpt4 book ai didi

php - ACF 错误信息

转载 作者:太空宇宙 更新时间:2023-11-04 02:12:11 27 4
gpt4 key购买 nike

我正在制作我的第一个 WordPress 主题,并使用高级自定义字段在主页上创建一个服务部分。

他使用的自定义字段是Repeater字段、Text字段、Textarea字段和Image字段。

我在 content-services.php 文件中设置了所有内容,但是当我加载 WordPress 站点时,我收到一条错误消息,指出 Parse error: syntax error, unexpected 'endif' (T_ENDIF), expecting end of file在/Users/brandonpowell/sites/valet/pixelcitytheme/web/app/themes/pixelcitytheme/templates/partials/content-services.php 第 46 行

<section class="services cf">
<div class="wrapper">
<?php // Start the loop
while ( have_posts() ) : the_post(); ?>
<?php if (the_rows('services_sections') ):
while ( have_rows('services_sections') ): the_row(); ?>
<div class="service">
<div class="box-service">
<div class="pull-left">
<?php
$image = get_sub_field('services_icon');
if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
</div>
<div class="right-word">
<h3><?php the_sub_field('service_title') ?></h3>
<p><?php the_sub_field('services_description')?></p>
</div>
</div>
<div class="line"></div>
<div class="box-service">
<div class="pull-left">
<?php
$image = get_sub_field('services_icon');
if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
</div>
<div class="right-word">
<h3><?php the_sub_field('service_title') ?></h3>
<p><?php the_sub_field('services_description')?></p>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php endwhile; endif; // End of the Loop. ?>
</div>
</section>

这是我试图在我的浏览器上创建的图表。

enter image description here

最佳答案

你有 3x'if' 和 4x'endif'。变化:
结束时;万一;//循环结束。
至:
结束时;//循环结束。

关于php - ACF 错误信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39551711/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com