Support

Account

Home Forums Bug Reports Flexible Content data still in wp_postmeta after layout removed Reply To: Flexible Content data still in wp_postmeta after layout removed

  • So, the problem here isn’t that the layout stays in the db, the problem is that you need to check these conditional fields for more than if they have content or not. This code is not exactly what you’ll need to use in your case but it should give you an idea.

    
    $condition = get_field('your_condition_field');
    if ($condition == '100') {
      if (get_field('content_1')) {
        // do stuff to output content 1
      }
    }
    if ($condition == '33/66') {
      if (get_field('content_2')) {
        // do stuff to output content 2
      }
    }
    if ($condition == '33/33/33') {
      if (get_field('content_3')) {
        // do stuff to output content 3
      }
    }