188 Posts
uriel
4 years ago
2
Topic

Hello When I put the code in the override List - ITEM

<?php $items = $cck->getItems(); ?>


<?php foreach( $items as $item )

{ echo $item->get('field')->value; } ?>

have: 

post 1 post 2 

post1 post2 

post 1 post 2 

post1 post2 

Shape I wish 

post1 post2 

What has changed? 

I need to insert an advertisement every 10 posts. But he repeats it wrong. 

Post 1 
advertisement
post 2 


Hugs

Get a Book for SEBLOD
332 Posts
Kenneth
4 years ago
1
Level 1

Hi. I've solved issues like this before by the use of a code to count instanses and then place something in each place I need it.

$counter++; // to count each time the code is run

Then:

if ($counter == '10') {

echo 'your code'; // your ad code

$teller = 0; // reset it so that if there are 10 new items, a new ad code will be placed

}

You can see my version at play over at https://drm24.no (here I use an external ad system, but the code above is how I place them in the right places on the front page)

188 Posts
uriel
4 years ago
0
Level 2

Hi

I used my theme seb json. https://github.com/Uriel29/seb_json

Hugs

Get a VIP membership