bogdanbatsenko

Untitled

Apr 23rd, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <?php if( get_row_layout() == 'image-fullwidth' ): ?>
  2. <div class="image-fullwidth">
  3. <div class="container">
  4. <?php $title = get_sub_field('title'); ?>
  5. <?php
  6. if( have_rows('columns') ):
  7. while( have_rows('columns') ): the_row(); ?>
  8. <?php
  9. $content = get_sub_field( 'content' );
  10. //$columns = get_sub_field('columns');
  11. $columns = the_row('columns');
  12. $count = count(get_sub_field( 'content' ));
  13.  
  14. ?>
  15.  
  16. <?php
  17.  
  18. if ( $count >= 1 ) { ?>
  19.  
  20. <div class="image-fullwidth__title"><?php echo $title; ?></div>
  21. <div class="grid2">
  22. <?php foreach ($columns as $item) { ?>
  23.  
  24. <?php echo '<div class="formatted">' . $content . '</div>' .
  25. '<div class="formatted">' . $item . '</div>'; ?>
  26.  
  27. </div>
  28.  
  29. <?php } ?>
  30.  
  31. <?php } else { ?>
  32.  
  33. <div class="image-fullwidth__title text-center"><?php echo $title; ?></div>
  34. <div class="text-center">
  35. <?php echo $content; ?>
  36. </div>
  37.  
  38. <?php } ?>
  39.  
  40.  
  41. <?php endwhile; ?>
  42. </div> <!-- container -->
  43. <?php endif; ?>
  44. </div> <!-- image-fullwidth -->
Advertisement
Add Comment
Please, Sign In to add comment