What shall we be held doing wrong? Simply to warn you this really is my first attempt for php so pardon my lack of knowledge )

Presently using Wordpress having a wordpress plugin known as Advanced Custom Fields. Which enables you to definitely create custom area options within the after sales of wordpress.


I'm looking to get a div to cover if the need for the Advanced Custom Area "Available" (the industry choose list) is placed to "No". The div is really a marker for that 10 available flats that overlays a roadmap. Presently it shows all 10 markers be it availability is placed to "No" or "Yes".

$i = 201;
$available = get_field('available');

while ($i <= 210) :
  if ($available == 'No') {
    echo '<div id="apt-' . $i . '" class="map-marker" style="display:none;"></div>';
  } elseif ($available) {
    echo '<div id="apt-' . $i . '" class="map-marker">';
    echo  $i++;

what exactly are you attempting to accomplish here? the get_area function is really a per publish informed method, so you should be iterating within the whole posts collection using the

while ($loop->have_posts()) : $loop->the_post();

if you are not utilizing a custom loop you'd leave from the $loop-> part.

you most likely have to publish the entire page template. you may simply need to perform some studying using blogging platforms concerning the loop and just how it really works.