在中继器内使用中继器
Use repeater inside repeater
我想知道这段代码有什么问题,它没有显示第二个转发器(第一个转发器中的那个):
<?php
$post_links = get_field("box_download");
if ($post_links) {?>
<div> <?php
foreach($post_links as $link){?>
<div style="download-box">
<?php if(!empty($link['season'])){?>
<span class="title"> فصل : <span class="title-content"><?php echo $link['season']?></span></span><?php }; ?>
<?php if(!empty($link['episode'])){ ?>
<span class="title"> تعداد قسمت ها :<span class="title-content"><?php echo $link['episode']?></span></span><?php }; ?>
<?php if(!empty($link['resolution_serie'])){ ?>
<span class="title"> کیفیت :<span class="title-content"><?php echo $link['resolution_serie']?></span></span><?php }; ?>
<?php if(!empty($link['average_size'])){ ?>
<span class="title"> میانگین حجم :<span class="title-content"><?php echo $link['average_size']?></span></span><?php }; ?>
<?php if(!empty($link['encoder_serie'])){ ?>
<span class="title"> انکودر :<span class="title-content"><?php echo $link['encoder_serie']?></span></span><?php }; ?>
</div>
<div class="links">
<?php
$post_something = $link['links'];
echo $post_something['field_name'];
?>
</div>
<?php };
?>
</div>
<?php }; ?>
它没有显示 $post_something['field_name']
$link['links']
是一个数组,您应该添加要访问的索引或使用 it.replace $post_something = $link['links'];
和 $post_something = $link['links'][0];
的循环
我想知道这段代码有什么问题,它没有显示第二个转发器(第一个转发器中的那个):
<?php
$post_links = get_field("box_download");
if ($post_links) {?>
<div> <?php
foreach($post_links as $link){?>
<div style="download-box">
<?php if(!empty($link['season'])){?>
<span class="title"> فصل : <span class="title-content"><?php echo $link['season']?></span></span><?php }; ?>
<?php if(!empty($link['episode'])){ ?>
<span class="title"> تعداد قسمت ها :<span class="title-content"><?php echo $link['episode']?></span></span><?php }; ?>
<?php if(!empty($link['resolution_serie'])){ ?>
<span class="title"> کیفیت :<span class="title-content"><?php echo $link['resolution_serie']?></span></span><?php }; ?>
<?php if(!empty($link['average_size'])){ ?>
<span class="title"> میانگین حجم :<span class="title-content"><?php echo $link['average_size']?></span></span><?php }; ?>
<?php if(!empty($link['encoder_serie'])){ ?>
<span class="title"> انکودر :<span class="title-content"><?php echo $link['encoder_serie']?></span></span><?php }; ?>
</div>
<div class="links">
<?php
$post_something = $link['links'];
echo $post_something['field_name'];
?>
</div>
<?php };
?>
</div>
<?php }; ?>
它没有显示 $post_something['field_name']
$link['links']
是一个数组,您应该添加要访问的索引或使用 it.replace $post_something = $link['links'];
和 $post_something = $link['links'][0];