Last active
April 24, 2019 13:23
-
-
Save DrewDahlman/ce2dd4f110dfc10c10637f5b599429fe to your computer and use it in GitHub Desktop.
Sample ACF page builder switch statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
while( have_rows('page_content')): the_row(); | |
switch(get_row_layout()){ | |
case "copy_&_image": | |
include("blocks/copy.php"); | |
break; | |
case "single_column": | |
include("blocks/single.php"); | |
break; | |
case "image_gallery": | |
include("blocks/image-gallery.php"); | |
break; | |
case "video": | |
include("blocks/video.php"); | |
break; | |
case "offers": | |
include("blocks/offer.php"); | |
break; | |
} | |
endwhile; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment