Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created August 17, 2014 23:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/448683bf5a6471765519 to your computer and use it in GitHub Desktop.
Save billerickson/448683bf5a6471765519 to your computer and use it in GitHub Desktop.
Using flexible content from ACF without ACF functions.
<?php
$rows = get_post_meta( get_the_ID(), 'be_content', true );
foreach( $rows as $count => $row ) {
switch ( $row ) {
case 'type_1':
$content = get_post_meta( get_the_ID(), 'be_content_' . $count . '_field_name', true );
echo '<div class="type-one">' . wpautop( $content ) . '</div>;
break;
case 'type_2':
$content = get_post_meta( get_the_ID(), 'be_content_' . $count . '_field_name', true );
echo '<div class="type-two">' . wpautop( $content ) . '</div>';
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment