A Cozmoslabs Product
Documentation / Custom Fields Creator / How to / Using Conditional Statements

Using Conditional Statements

Considering we have a Repeater Meta Box with the following fields: Event Name, Event Description and Event Date and we want to display the results only if the Event Name and Event Description are filled in:

';
   foreach( $event_list as $key => $event ){
       $event_name = get_cfc_field( 'event_list','event-name', false, $key );
       $event_date = get_cfc_field( 'event_list','event-date', false, $key );
       $event_description = get_cfc_field( 'event_list','event-description', false, $key );
       if( !empty( $event_name ) && !empty( $event_date ) ){
           echo '
  • '; echo '
    '. $event_name .'
    '; echo '
    '. $event_description .'
    '; echo '
    '. $event_date .'
    '; echo '
  • '; } } echo ''; } ?>

    The Ultimate Membership Bundle

    Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

    Get 25% off with the bundle

    Help & Support

    We’re here to help you every step of the way.

    Open a Support Ticket