Reply To: Default to 'full width', instead of 'right sidebar'?

New Front EN Support Forums Kanso Theme Support Default to 'full width', instead of 'right sidebar'? Reply To: Default to 'full width', instead of 'right sidebar'?

#3664
thoughton
Participant

Okay I’ve fiddled around and got nowhere fast :)

I’m trying something like this:

if( get_post_type($post->ID) == 'project' ) {
$kanso_sd_meta_box = array(
'id' => 'post-layout-choice',
'title' => 'Post Layout',
'page' => 'post',
'context' => 'side',
'priority' => 'core',
'fields' => array(
array(
'name' => 'Pick one:',
'id' => $kanso_sd_prefix . 'post-layout',
'type' => 'select',
'options' => array('Full Width','Right Sidebar','Left Sidebar')
)
)
);
} else {
$kanso_sd_meta_box = array(
'id' => 'post-layout-choice',
'title' => 'Post Layout',
'page' => 'post',
'context' => 'side',
'priority' => 'core',
'fields' => array(
array(
'name' => 'Pick one:',
'id' => $kanso_sd_prefix . 'post-layout',
'type' => 'select',
'options' => array('Right Sidebar','Full Width','Left Sidebar')
)
)
);
}

Obviously I’m doing something wrong :) Is there an if I can use to make the ‘options’ conditional? Thanks!

  • This reply was modified 10 years, 10 months ago by thoughton.
  • This reply was modified 10 years, 10 months ago by thoughton.