
hi, i think the main part should look like this
<?php $carousel = get_field('carousel');
if($carousel):
while( have_rows('carousel') ): the_row();
$slider_image = "";
$slide_headline = "";
$sub_headline = "";
$button_url = "";
$button_text = "";
$slider_image = get_sub_field('slider_image');
$slide_headline = get_sub_field('slide_headline');
$sub_headline = get_sub_field('sub_headline');
$button_url = get_sub_field('button_url');
$button_text = get_sub_field('button_text');
?>
<div class="item slides">
<div class="cslide" style="background: url(<?php echo $slider_image; ?>)"></div>
<div class="hero">
<hgroup>
<h1><?php echo $slide_headline; ?></h1>
<h3><?php echo $sub_headline; ?></h3>
</hgroup>
<a href="<?php echo $button_url; ?>"><button class="btn btn-hero btn-lg" role="button"><?php echo $button_text; ?></button></a>
</div>
</div>
<?php endwhile; endif;?>
hope that help.
depends on what is required, and what your image output is, you may need to adjust your code. here a sample how to make a optional field and get image when use array
<php? if($my_teaserimage){
echo '<div class="teaserimage"><img src="'. $my_teaserimage['url'] .'" /></div>';
} ?>

as far as i understand:
conditionally hiding save only visible field. that why it allows you to skip some “may required” fields. it never does or should delete saved values by switch condition.
if you delete something and switch. delete is not saved because everything is only saved when it is visible and you click save.
to be fair/true: 😉 your main problem is not hidden or not hidden, you try to delete a required field. and a required field is like a radio-button with 1 value. you cant deselect it once set. this is something that is not possible without additional coding or a workaround.
one way to remove a value from DB set by required-field is:
set it to not required, delete value, and save. after that set it back to required.
but that is not practical 😉 and nothing a customer should be able to do.
what (may) should work too is: duplicate image-field (same field-name!)
show it at color but set it as not required. (set conditionals same as color)
let original required at image conditional.
if you switch from image to color: required image set by image is shown as not required at color. image can be deleted there because it is not required.
with that it can be saved, but customer had to delete it manually.
it may could work with a update_value filter and wp_update_post too
but my advise: solve problem at save_post action or with flexible field

5.1.9 translations are buggy.
try to update to 5.1.9.1 that should fix translation bug.
if fields are gone for edit content, look at top right inside options if checkbox with acf-fieldgroup-name is not ticked (there were you manage what is visible or not)
at my site it was deactivated after update.

@MattRobinson
your problem is that fields are gone for edit content?
at top right inside options there were you manage what is visible or not,
is the checkbox with acf-fieldgroup-name ticked or not?

5.1.9 translations are buggy.
try to update to 5.1.9.1 that should fix translation bug.
(for german it was ok after update, hope it is also ok for polish)
if fields are gone for edit content, look at top right inside options checkbox with acf-fieldgroup-name is maybe not ticked (there were you manage what is visible or not)

for populate a filled out value at frontend you can do something like that:
<?php
/*
* Create PHP DateTime object from Date Piker Value
* this example expects the value to be saved in the format: yymmdd (JS) = Ymd (PHP)
*/
$date = DateTime::createFromFormat('Ymd', get_field('date_picker'));
echo $date->format('d-m-Y');
?>
official Datepicker Documentation
or did you wish to prefill a datepicker field?

try to look if checkbox with acf-field-group is active (there where you manage what is visible or not) at my site it was deactivated after update.

try to update to 5.1.9.1 that should fix translation bug.
if fields are gone for edit content, look at top right inside options if checkbox with acf-fieldgroup-name is not ticked (there were you manage what is visible or not)

there is a update 5.1.9.1 that looks like it fix the Problem.
what i had also to do was: at Content, top at options that manage what is visible or not.
i had to re-tick the check-box with the acf-fieldgroup name, after that fieldgroups reappear.

i think it could be done with a repeater.
where you have a weight text-field inside and add a new row each month.

ok. i know the problem. could you try if this works for you
<!-- model specifications -->
<?php if( have_rows('model_specifications') ):
$firstrow = "1";
while( have_rows('model_specifications') ): the_row();
$ms_model = get_sub_field('model');
$ms_gpm = get_sub_field('gpm');
$ms_input = get_sub_field('input');
$ms_psi = get_sub_field('psi');
$ms_drive = get_sub_field('drive');
$ms_rpm = get_sub_field('rpm');
$ms_drive_rpm = get_sub_field('drive_rpm');
$ms_hp = get_sub_field('hp');
$ms_volt = get_sub_field('volt');
$ms_hp_volt = get_sub_field('hp_volt');
$ms_power = get_sub_field('power');
$ms_engine = get_sub_field('engine');
$ms_burner = get_sub_field('burner');
$ms_electric_start = get_sub_field('electric_start');
$ms_size = get_sub_field('size');
if($firstrow == "1") :
echo '<div id="model-specifications">';
echo '<table class="rwd-table">';
echo '<thead>';
echo '<tr>';
if ($ms_model) {echo '<th>Model</th>';}
if ($ms_gpm) {echo '<th>GPM</th>';}
if ($ms_input) {echo '<th>Input</th>';}
if ($ms_psi) {echo '<th>PSI</th>';}
if ($ms_drive) {echo '<th>Drive</th>';}
if ($ms_rpm) {echo '<th>RPM</th>';}
if ($ms_drive_rpm) {echo '<th>Drive RPM</th>';}
if ($ms_hp) {echo '<th>HP</th>';}
if ($ms_volt) {echo '<th>Volt</th>';}
if ($ms_hp_volt) {echo '<th>HP / Volt</th>';}
if ($ms_power) {echo '<th>Power</th>';}
if ($ms_engine) {echo '<th>Engine</th>';}
if ($ms_burner) {echo '<th>Burner</th>';}
if ($ms_electric_start) {echo '<th>Electric Start</th>';}
if ($ms_size) {echo '<th>Size</th>';}
echo '<th>Quote</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
endif;
$firstrow++;
echo '<tr>';
if ($ms_model) {echo '<td data-th="Model">'.$ms_model.'</td>';}
if ($ms_gpm) {echo '<td data-th="GPM">'.$ms_gpm.'</td>';}
if ($ms_input) {echo '<td data-th="Input">'.$ms_input.'</td>';}
if ($ms_psi) {echo '<td data-th="PSI">'.$ms_psi.'</td>';}
if ($ms_drive) {echo '<td data-th="Drive">'.$ms_drive.'</td>';}
if ($ms_rpm) {echo '<td data-th="RPM">'.$ms_rpm.'</td>';}
if ($ms_drive_rpm) {echo '<td data-th="Drive RPM">'.$ms_drive_rpm.'</td>';}
if ($ms_hp) {echo '<td data-th="HP">'.$ms_hp.'</td>';}
if ($ms_volt) {echo '<td data-th="Volt">'.$ms_volt.'</td>';}
if ($ms_hp_volt) {echo '<td data-th="HP / Volt">'.$ms_hp_volt.'</td>';}
if ($ms_power) {echo '<td data-th="Power">'.$ms_power.'</td>';}
if ($ms_engine) {echo '<td data-th="Engine">'.$ms_engine.'</td>';}
if ($ms_burner) {echo '<td data-th="Burner">'.$ms_burner.'</td>';}
if ($ms_electric_start) {echo '<td data-th="Electric Start">'.$ms_electric_start.'</td>';}
if ($ms_size) {echo '<td data-th="Size">'.$ms_size.'</td>';}
echo '<td data-th="Quote"><a href="/request-a-quote/?">Request a Quote</a></td>';
echo '</tr>';
endwhile;
echo '</tbody>';
echo '</table>';
echo '</div>';
?>
<?php endif; ?>
<!-- end model specifications -->

the difference is what you get when you use get_field
try to look yourself
$value = get_field('your_file_field_name');
echo '<pre>';
print_r( $value );
echo '</pre>';
it is either a ID, a URL, or a array that contains both and probably even more infos

i can confirm that acf-de_DE.mo is corrupt.
after recreating it from the acf-de_DE.po file it looks normal again. (po file from 5.1.9)
New added functions by 5.1.9 are not translated inside po file from 5.1.9 (but at least backend is re-usable)

hi
try if it works when you remove the while loop inside tbody

it is also possible that shortcode unfortunately get formatted, than this should work:
<?php $shortcode = get_field('request_demo_shortcode', false, false);
do_shortcode($shortcode);?>
(3 parameter should be false)

you have to use the post/page-ID there too. (else it search only at current page)
probably this works:
$description = get_field( 'description', $page->ID );
echo $description;

this should work:
<?php $images = get_field('gallery');
if( $images ): ?>
<div class="gallery">
<ul>
<?php foreach( $images as $image ):
$content = '<li>';
$content .= '<a class="gallery_image" href="'. $image['url'] .'">';
$content .= '<img src="'. $image['sizes']['thumbnail'] .'" alt="'. $image['alt'] .'" />';
$content .= '</a>';
$content .= '</li>';
if ( function_exists('slb_activate') ){
$content = slb_activate($content);
}
echo $content;?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

you need to add a js libary that provides the popup functionality.
with plugins Simple Lightbox you can use:
<?php $images = get_field('gallery');
if( $images ): ?>
<div class="gallery">
<ul>
<?php foreach( $images as $image ):
$content = '<li>';
$content .= '<a class="gallery_image" href="'. $image['url'] .'">';
$content .= '<img src="'. $image['sizes']['thumbnail'] .'" alt="'. $image['alt'] .'" />';
$content .= '</a>';
$content .= '</li>';
if ( function_exists('slb_activate') ){
$content = slb_activate($content);
}
echo $content;?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

there are 3 way so solve that problem:
because with a conditional filter you just hide the field at backend, value remains inside DB

it is possible, just check if value is there
but for that you need to re-arrange / re-write your code.
here a part of it. just add the other rows the same way.
<?php if( have_rows('model_specifications') ):
while( have_rows('model_specifications') ): the_row();
$ms_model = get_sub_field('model');
$ms_gpm = get_sub_field('gpm');
endwhile;
echo '<div id="model-specifications">';
echo '<dl>';
if ($ms_model) {echo '<dt class="model">Model</dt>';}
if ($ms_gpm) {echo '<dt class="gpm">GPM</dt>';}
if ($ms_model) {echo '<dd class="model">'.$ms_model.'</dd>';}
if ($ms_gpm) {echo '<dd class="gpm">'.$ms_gpm.'</dd>';}
echo '</dl>';
?>

you may need to loop it through slb_activate()
details here

i would recommend do something like that:
<?php
$images = get_field('gallery');
$img_count=1;
if( $images ): ?>
<?php foreach( $images as $image ):
if ($img_count == 1) { ?>
<div class="large">
<a rel="gallery" href="<?php echo $image['url']; ?>">
<img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />
</a>
</div>
<?php } else {?>
<div class="thumb">
<a rel="gallery" href="<?php echo $image['url']; ?>">
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
</a>
</div>
<?php }
$img_count++; ?>
<?php endforeach; ?>
<?php endif; ?>
instead of trying to use css only.
you probably need to add a popup-script like fancybox too, to get a result like your example.
(with help of css3, it should be possible for new browsers, to do a css only solution. look at :first-of-type for example, but i would not recommend that)

sure you can have repeater inside flexible field.
from original docs here
Nested Loop
<?php
// check if the flexible content field has rows of data
if( have_rows('flexible_content_field_name') ):
// loop through the rows of data
while ( have_rows('flexible_content_field_name') ) : the_row();
// check current row layout
if( get_row_layout() == 'gallery' ):
// check if the nested repeater field has rows of data
if( have_rows('images') ):
echo '<ul>';
// loop through the rows of data
while ( have_rows('images') ) : the_row();
$image = get_sub_field('image');
echo '<li><img src="' . $image['url'] . '" alt="' . $image['alt'] . '" /></li>';
endwhile;
echo '</ul>';
endif;
endif;
endwhile;
else :
// no layouts found
endif;
?>
basically it is nothing very special. it is just a (repeater) loop inside a (flexible content) loop

the number of images should be the number of rows from your repeater field.
that means you can get it like that:
<?php if( have_rows('gallery') ):
$gallery_rows= get_field('gallery');
$total_images = count($gallery_rows);
endif; ?>

@paaljoachim if you don’t open <article> remove the closing </article>, and remove a closing </div> too. it looks like my original code has also one to much.
replace </div></div></article> with </div> else it looks fine
or add something like that <article itemtype="http://schema.org/CreativeWork" itemscope="itemscope" class="post-<?php print $pageid; ?> page type-page status-publish entry"><div class="entry-content" itemprop="text"> above <div class="movie-content">
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.