Using php if else statement in display suite
If your need is simple, a "hide when empty" for example, you definitely need to look into Field formatter conditions module, it will allow you do simple conditions on your field formatters for a given view mode.



If that's not enough, Display Suite allows to have arbitrary fields added to the view modes, you need to look into hook_ds_fields_info and implement it in a custom module for your needs.

/**
 * Implements hook_ds_fields_info()
 */
function my_module_ds_fields_info($entity_type) {
  $fields = array();

  $fields['my_field'] = array(
    'title' =&gt; t('My field'),
    'field_type' =&gt; DS_FIELD_TYPE_FUNCTION,
    'ui_limit' =&gt; array('node_type|*'),
    'function' =&gt; 'my_module_callback_function',
  );

  return array('node' =&gt; $fields);
}

function my_module_callback_function(&amp;$field) {
  // Here goes your code, the conditions to display or not another field
  // and return an array with the data.
}


Further examples in https://stackoverflow.com/questions/16253312/using-hook-ds-fields-info-is-there-a-way-to-use-standard-formatters-so-the-op and http://www.previousnext.com.au/blog/creating-custom-display-suite-fields-or-how-i-learned-stop-worrying-and-use-hookdsfieldsinfo