Deprecated: Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead. in /var/www/html/wp-includes/functions.php on line 5383

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 9 years, 11 months ago by thoughton.
  • This reply was modified 9 years, 11 months ago by thoughton.