php - 如何修复警告:非法字符串偏移“描述”
问题描述
在对 WP 进行了一些更新后,我的旧主题在 single-service.php 中损坏了警告:第 40、44、48 行的非法字符串偏移 'description'、programm'、'duration' .../wp-content/themes/haircut/single -service.php
<!-- CONTENT -->
<section class="xx_content">
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="service_description desc">
<h3>Курс "<?php the_title(); ?>"</h3>
<?php if ($service_fields['description'] != '') {
echo $service_fields['description'];
} ?>
<?php if ($service_fields['programm'] != '') { ?>
<h5>Програма курсу</h5>
<?php echo $service_fields['programm']; ?>
<?php } ?>
<?php if ($service_fields['duration'] != '') { ?>
<h5>Тривалість</h5>
<?php echo $service_fields['duration']; ?>
<?php } ?>
</div>
</article>
<?php endwhile; endif; wp_reset_query();?>
</section>
<!-- /CONTENT -->
解决方案
推荐阅读
- bash - 根据文件名删除一些文件
- java - 如何使用 gradle 获取 Hibernate Search Lucene 的所有依赖项?
- c# - 从特定点而不是中心旋转图像c#
- python - 如何忽略python中的打印输出?
- foursquare - 在 apifoursquare 上发送请求时出现 403 响应代码
- xml - 使用 XSLT 对 XML 中的一个元素进行分组
- java - 如何将二叉树中的节点推送到数组中?
- javascript - Moment.js HTTP 服务器结果当前未正确输出
- python - 如何在使用 BeautifulSoup 解析页面时仅获取有效的 url 链接?
- websocket - 模式匹配 gremlin 查询的结果只有在有 91 个匹配查询时才返回 64 个顶点