Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. require __DIR__ . '/kirby/bootstrap.php';
  4.  
  5. // echo (new Kirby)->render();
  6.  
  7. $items = page('blog')->children();
  8.  
  9. foreach ($items as $item) {
  10. if ($i = $item->cover()->toFile()) {
  11. $i->update([
  12. 'template' => 'cover',
  13. ]);
  14. }
  15.  
  16. foreach ($item->gallery()->split(',') as $image) {
  17. if ($i = $item->file($image)) {
  18. $i->update([
  19. 'template' => 'gallery',
  20. ]);
  21. }
  22. }
  23.  
  24. $item->update([
  25. 'cover' => null,
  26. 'gallery' => null,
  27. ]);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement