Skip to content

Instantly share code, notes, and snippets.

@DrewDahlman
Last active April 24, 2019 13:23
Show Gist options
  • Save DrewDahlman/ce2dd4f110dfc10c10637f5b599429fe to your computer and use it in GitHub Desktop.
Save DrewDahlman/ce2dd4f110dfc10c10637f5b599429fe to your computer and use it in GitHub Desktop.
Sample ACF page builder switch statement
<?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