番号付きのクラスが必要なforeachループがあるので、カウンターを設定します。
<?php
$counter = 0;
?>
<?php
$html = '';
foreach ($json['feed']['entries'] as $entries){
$counter++;
$html .= '<a href="' .$entries['link']. '"><span class="feeddisplay_title">'.$entries['title']. ' </span></a>';
if($entries['publishedDate'] != '') {
$html .='<span class="feeddisplay_date">' .$entries['publishedDate']. '</span>';
}
$html .= '<p>' .$entries['contentSnippet']. '</p>';
}
?>
<div class="box feed-<?php echo $counter; ?>">
<div class="box-heading"><?php echo $heading_title; ?>:</div>
<div class="box-content">
<div class="feeddisplay"><?php echo $html ?></div>
</div>
</div>
そして、私の出力クラスは何度も「feed-1」です。上がりません。いくつかのバリエーションを試しましたが、行き詰まりました。