Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( have_rows('banner_layout') ):
- echo "Banner<br>";
- while( have_rows('banner_layout') ) : the_row();
- // Get values from ACF
- if( get_row_layout() == 'heading_+_form'):
- $heading_text = get_sub_field('heading_text');
- $form_id = get_sub_field('form_id');
- $background_image = get_sub_field('background_image');
- elseif ( get_row_layout() == 'heading_(background)_+_form'):
- $heading_text = get_sub_field('heading_text');
- $form_id = get_sub_field('form_id');
- $background_image = get_sub_field('background_image');
- $background_text_color = get_sub_field('text_background_color');
- elseif ( get_row_layout() == 'heading_only'):
- $heading_text = get_sub_field('heading_text');
- $background_image = get_sub_field('background_image');
- endif;
- endwhile;
- // Output the HTML
- if($heading_text){
- echo "Value for heading text is ".$heading_text."<br>";
- };
- if($form_id) {
- echo "Value for form id is ".$form_id."<br>";
- };
- if($background_image) {
- echo "Value for background image is ".$background_image."<br>";
- };
- if($background_text_color) {
- echo "Value for background text color field is ".$background_text_color."<br>";
- };
- else :
- // no content
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement