Created
August 17, 2014 23:06
-
-
Save billerickson/448683bf5a6471765519 to your computer and use it in GitHub Desktop.
Using flexible content from ACF without ACF functions.
This file contains 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 | |
$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