Support » Plugin: Block Lab » Code Question About For Loops

  • Resolved joshuamadrid

    (@joshuamadrid)


    I am Trying to write a for loop and allow the use of adding more to the block why is this erroring?

    <div id="<?php block_field('custom-id'); ?>" class="btn-group <?php block_field('custom-class'); ?>" role="group">
        <?php
        $BTN_NUM = block_value('number-buttons');
        for ($i = 0; $i < $BTN_NUM; $i++) {
            echo '<button href="' + block_field('button-url-' + $i ) + '" type="button" class="btn ' + block_field('button-type-' + $i ) + '">' ;
                block_field('button-text-' + $i );
            echo '</button>' ;
        }
        ?>
    </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.