Title: Using if Statement Prints Condition value?
Last modified: February 26, 2020

---

# Using if Statement Prints Condition value?

 *  Resolved [Tory](https://wordpress.org/support/users/tmac187/)
 * (@tmac187)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/)
 * In my template I have an if statement like so:
    `if (block_field( 'add-row-2')
   == 'Yes') { ?> <tr class="sortabletr"><td class="model-image"> Test </td></tr
   > <?php }` What’s odd is it prints “Yes” on the page above the table this code
   sits in. Any ideas why? I have no code to echo or print it. If I remove the if
   statement then the “Yes” is removed.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/#post-12484887)
 * Hi [@tmac187](https://wordpress.org/support/users/tmac187/),
    Thanks for bringing
   that up, and for using Block Lab.
 * Using `block_value( 'add-row-2' )` should prevent printing it to the front-end.
   Does that help?
 *  Thread Starter [Tory](https://wordpress.org/support/users/tmac187/)
 * (@tmac187)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/#post-12484895)
 * Thanks for the quick reply! That did remove the “Yes” from being displayed, but
   now the if statement isn’t working. If I uncheck the add-row-2 checkbox, it still
   shows <tr class=”sortabletr”><td class=”model-image”> Test </td></tr>
 *  Thread Starter [Tory](https://wordpress.org/support/users/tmac187/)
 * (@tmac187)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/#post-12484902)
 * Ok, I got it. i changed the if statement to
 * `if (block_value( ‘add-row-9’ ) != 0) {‘
 * and it worked! Thanks for the help. Great plugin!
 *  Thread Starter [Tory](https://wordpress.org/support/users/tmac187/)
 * (@tmac187)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/#post-12487539)
 * Marking as resolved
 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/#post-12538824)
 * Nice, thanks a lot for using Block Lab!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Using if Statement Prints Condition value?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/block-lab_5c34e8.svg)
 * [Block Lab](https://wordpress.org/plugins/block-lab/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/block-lab/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/block-lab/)
 * [Active Topics](https://wordpress.org/support/plugin/block-lab/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-lab/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-lab/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/using-if-statement-prints-condition-value/#post-12538824)
 * Status: resolved