Tagged: acf, caption, custom fields, Masonry Gallery
-
AuthorPosts
-
June 12, 2018 at 9:01 am #971573June 13, 2018 at 9:53 am #972159
Hey Portfoli0CSG,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJune 14, 2018 at 12:48 am #972554Hi Victoria,
I’ve added access information into this replies Private Content.
Thank you.
June 15, 2018 at 11:21 am #973241Hi Portfoli0CSG,
Thanks for giving us admin and ftp access, can you try to replace this code:
$beds = the_field(‘bedrooms’); $bath = the_field(‘bathrooms’); $car = the_field(‘car_spaces’); $rent = the_field(‘rent’);
to:
$beds = get_field('bedrooms'); $bath = get_field('bathrooms'); $car = get_field('car_spaces'); $rent = get_field('rent');
Let us know if this helps.
Best regards,
NikkoJune 18, 2018 at 1:07 am #974056Unfortunately this doesn’t work either…
June 18, 2018 at 4:02 pm #974331Hi Portfoli0CSG,
It didn’t work because the code is wrong, I have replaced this code:
$beds = get_field('bedrooms'); if($beds) { echo '<ul class="test123">'; foreach($beds as $beds) { echo '<li>' . $beds . '</li>'; } echo '</ul>'; }
to:
$beds = get_field('bedrooms', $entry['ID']); if( (int)$beds > 1 ) { $beds = $beds . ' BEDS'; } else { $beds = $beds . ' BED'; }
and it works fine.
This is already outside the scope of our support but I hope this helps, also you can check on ACFs documentation on how it works.
Also just a tip, instead of using text for bedrooms or other fields that uses numbers, you can use the Number field type.
Hope it helps.Best regards,
NikkoJune 19, 2018 at 2:32 am #974576Thank you so much! Works perfectly!
June 19, 2018 at 12:03 pm #974729Hi Portfoli0CSG,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.