Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Elliot Condon

    (@elliotcondon)

    Hey red

    You need to wrap the loop in an if statement. That way, if there is no rows returned, the loop will never run.

    <?php if(get_cf_matrix('Matrix Name')): ?>
    // do loop
    <?php endif; ?>
    Thread Starter swgt5

    (@red001)

    hi – I don’t know what I am doing! – I tried a couple of configurations but I am gusessing and nothing is working

    <?php if(get_cf_matrix(‘gallery’)): ?>
    <?php foreach(get_cf_matrix(‘gallery’) as $image):?>
    <table width=”650″ id=”matrix”>
    <tr>
    <td align=”left” valign=”top”><img src=”<?php echo $image->image_url; ?>” width=”160″ alt=”<?php echo $image->image_alt; ?>”></td>
    <td align=”left” valign=”top”><?php echo $image->image_description; ?></td>
    <td align=”left” valign=”top” class=”contact”><?php echo $image->image_contact; ?></td>
    <td align=”left” valign=”top”><?php echo ‘url.'”>’.$image->url.’‘; ?></td>
    </tr>
    </table>
    <?php endforeach; ?>
    <?php endif; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘any pages without the Custom Field Matrix shows the table and a broken image’ is closed to new replies.