Example #1
0
 function thb_theme_layout_options()
 {
     global $page_templates, $single_post, $portfolio, $masonry, $page_layout_templates;
     $thb_container = new THB_MetaboxFieldsContainer('', 'extra_container');
     $thb_field = new THB_SelectField('pageheader_layout');
     $thb_field->setLabel(__('Page header alignment', 'thb_text_domain'));
     $thb_field->setOptions(array('left' => __('Left', 'thb_text_domain'), 'center' => __('Center', 'thb_text_domain'), 'right' => __('Right', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_SelectField('pageheader_height');
     $thb_field->setLabel(__('Page header height', 'thb_text_domain'));
     $thb_field->setOptions(array('pageheader-big' => __('Large', 'thb_text_domain'), 'pageheader-compact' => __('Compact', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_ColorField('background_color');
     $thb_field->setLabel(__('Background color', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('background_opacity');
     $thb_field->setLabel(__('Background opacity', 'thb_text_domain'));
     $thb_field->setMin('0');
     $thb_field->setMax('1');
     $thb_field->setStep('0.05');
     $thb_field->setDefault('0.85');
     $thb_container->addField($thb_field);
     foreach ($page_layout_templates as $template) {
         if (thb_is_admin_template($template)) {
             $post_type = thb_theme()->getPostType(thb_get_post_type_from_template($template));
             $post_type->getMetabox('layout')->addContainer($thb_container);
         }
     }
 }