function font($option) { if (empty($option['supports'])) { return 'Please make sure the option has the supports key set'; } $output = '<div class="zn_row">'; if (isset($option['std']['font-family'])) { $font_family = $option['std']['font-family']; } else { $font_family = ''; } // If supported font if (in_array('font', $option['supports'])) { $normal_fonts = zn_get_fonts(); $output .= '<div class="zn_span4">'; $output .= '<h4>Font Family</h4>'; $output .= '<select id="' . $option['id'] . '_font" class="zn_input" name="' . $option['id'] . '[font-family]">'; $output .= '<option disabled>Font Family</option>'; foreach ($normal_fonts as $key => $font) { $output .= '<option value="' . $key . '" ' . selected($font_family, $key, false) . '>' . $font . '</option>'; } $output .= '</select>'; $output .= '</div>'; } // If supprted font size if (in_array('size', $option['supports'])) { if (isset($option['std']['font-size'])) { $size = $option['std']['font-size']; } else { $size = ''; } $output .= '<div class="zn_span4">'; $output .= '<h4>Font Size</h4>'; $output .= '<select id="' . $option['id'] . '_size" class="zn_input" name="' . $option['id'] . '[font-size]">'; for ($i = 9; $i < 120; $i++) { $output .= '<option value="' . $i . 'px" ' . selected($size, $i . 'px', false) . '>' . $i . 'px</option>'; } $output .= '</select>'; $output .= '</div>'; } // If supprted line height if (in_array('line', $option['supports'])) { if (isset($option['std']['line-height'])) { $line = $option['std']['line-height']; } else { $line = ''; } $output .= '<div class="zn_span4">'; $output .= '<h4>Line Height</h4>'; $output .= '<select id="' . $option['id'] . '_line" class="zn_input" name="' . $option['id'] . '[line-height]">'; for ($i = 1; $i < 120; $i++) { $output .= '<option value="' . $i . 'px" ' . selected($line, $i . 'px', false) . '>' . $i . 'px</option>'; } $output .= '</select>'; $output .= '</div>'; } // If supprted font weight if (in_array('weight', $option['supports'])) { if (isset($option['std']['font-weight'])) { $saved_weight = $option['std']['font-weight']; } else { $saved_weight = ''; } $font_weight = array('400' => '400 (normal) ', '700' => '700 (bold)', '100' => '100', '200' => '200', '300' => '300', '500' => '500', '600' => '600', '800' => '800', '900' => '900'); $output .= '<div class="zn_span4">'; $output .= '<h4>Font Weight</h4>'; $output .= '<select id="' . $option['id'] . '_weight" class="zn_input" name="' . $option['id'] . '[font-weight]">'; foreach ($font_weight as $key => $weight) { $output .= '<option value="' . $key . '" ' . selected($saved_weight, $key, false) . '>' . $weight . '</option>'; } $output .= '</select>'; $output .= '</div>'; } // If supports font color if (in_array('color', $option['supports'])) { if (isset($option['std']['color'])) { $saved_color = $option['std']['color']; } else { $saved_color = ''; } $output .= '<div class="zn_span4">'; $output .= '<h4>Font color</h4>'; $output .= '<input type="text" class="zn_colorpicker" data-default-color="' . $saved_color . '" name="' . $option['id'] . '[color]" value="' . $saved_color . '" >'; $output .= '</div>'; } // If supprted font style if (in_array('style', $option['supports'])) { if (isset($option['std']['font-style'])) { $saved_style = $option['std']['font-style']; } else { $saved_style = ''; } $font_style = array('normal', 'italic'); $output .= '<div class="zn_span4">'; $output .= '<h4>Font Style</h4>'; $output .= '<select id="' . $option['id'] . '_style" class="zn_input" name="' . $option['id'] . '[font-style]">'; foreach ($font_style as $style) { $output .= '<option value="' . $style . '" ' . selected($saved_style, $style, false) . '>' . $style . '</option>'; } $output .= '</select>'; $output .= '</div>'; } $output .= '</div>'; return $output; }
$admin_options[] = array('slug' => 'posts_options', 'parent' => 'blog_options', 'id' => 'link_post_color', 'name' => 'Link post color', 'description' => 'This color will be used for the logo of the link post.', 'type' => 'colorpicker', 'std' => '#7647a7'); /*-------------------------------------------------------------------------------------------------- PAGE Options --------------------------------------------------------------------------------------------------*/ $admin_options[] = array('slug' => 'page_options', 'parent' => 'page_options', 'id' => 'show_oblique_heder', 'name' => 'Use oblique layout after header ?', 'description' => 'Choose if you want to enable the display the oblique layout after the page header.', 'type' => 'toggle2', 'value' => 'yes', 'std' => 'yes'); /*-------------------------------------------------------------------------------------------------- Google Fonts Setup --------------------------------------------------------------------------------------------------*/ // Google fonts $admin_options[] = array('slug' => 'google_font_options', 'parent' => 'google_font_options', 'id' => 'zn_google_fonts_setup', 'name' => 'Google Fonts Setup', 'description' => 'Here you can setup the <a href="https://www.google.com/fonts" target="blank">Google web fonts</a> that you want to use in your site.', 'type' => 'zn_google_fonts_setup', 'std' => array('Lato' => array('font_family' => 'Lato', 'font_variants' => array(0 => 'regular', 1 => '300', 2 => '700', 3 => '900'))), 'class' => 'zn_full'); // General fonts subset $admin_options[] = array('slug' => 'google_font_options', 'parent' => 'google_font_options', 'id' => 'zn_google_fonts_subsets', 'name' => 'Google Fonts Subset', 'description' => 'Select which subsets you want to load for the Google fonts.', 'type' => 'checkbox', 'options' => array('latin' => 'Latin', 'latin-ext' => 'Latin Ext', 'greek' => 'Greek', 'cyrillic' => 'Cyrillic', 'cyrillic-ext' => 'Cyrillic Ext', 'khmer' => 'Khmer', 'greek-ext' => 'Greek Ext', 'vietnamese' => 'Vietnamese'), 'std' => '', 'class' => 'zn_full'); /*-------------------------------------------------------------------------------------------------- Font Options --------------------------------------------------------------------------------------------------*/ $fonts = zn_get_fonts(); // Body fonts $admin_options[] = array('slug' => 'general_fonts', 'parent' => 'font_options', 'id' => 'body_fonts', 'name' => 'Main body font', 'description' => 'Here you can set-up the main theme font.', 'type' => 'select', 'std' => 'Lato', 'options' => $fonts); /*-------------------------------------------------------------------------------------------------- Unlimited Sidebars --------------------------------------------------------------------------------------------------*/ // Unlimited Sidebars $admin_options[] = array('slug' => 'unlimited_sidebars', 'parent' => 'unlimited_sidebars', 'id' => 'unlimited_sidebars', 'name' => 'Unlimited Sidebars', 'description' => 'Here you can create unlimited sidebars that you can use all over the theme.', 'type' => 'group', 'sortable' => false, 'element_title' => 'sidebar_name', 'subelements' => array(array('id' => 'sidebar_name', 'name' => 'Sidebar Name', 'description' => 'Please enter a name for this sidebar. Please note that the name should only contain alphanumeric characters', 'type' => 'text', 'supports' => 'block'))); // Sidebars settings $sidebar_options = array('sidebar_right' => 'Right sidebar', 'sidebar_left' => 'Left sidebar', 'no_sidebar' => 'No sidebar'); $admin_options[] = array('slug' => 'sidebar_settings', 'parent' => 'unlimited_sidebars', 'id' => 'archive_sidebar', 'name' => 'Sidebar on archive pages', 'description' => 'Please choose the sidebar position for the archive pages.', 'type' => 'sidebar', 'class' => 'zn_full', 'std' => array('layout' => 'sidebar_right', 'sidebar' => 'default_sidebar')); $admin_options[] = array('slug' => 'sidebar_settings', 'parent' => 'unlimited_sidebars', 'id' => 'blog_sidebar', 'name' => 'Sidebar on Blog', 'description' => 'Please choose the sidebar position for the blog page.', 'type' => 'sidebar', 'class' => 'zn_full', 'std' => array('layout' => 'sidebar_right', 'sidebar' => 'default_sidebar')); $admin_options[] = array('slug' => 'sidebar_settings', 'parent' => 'unlimited_sidebars', 'id' => 'single_sidebar', 'name' => 'Sidebar on single blog post', 'description' => 'Please choose the sidebar position for the single blog posts.', 'type' => 'sidebar', 'class' => 'zn_full', 'std' => array('layout' => 'sidebar_right', 'sidebar' => 'default_sidebar')); $admin_options[] = array('slug' => 'sidebar_settings', 'parent' => 'unlimited_sidebars', 'id' => 'page_sidebar', 'name' => 'Sidebar on pages', 'description' => 'Please choose the sidebar position for the pages.', 'type' => 'sidebar', 'class' => 'zn_full', 'std' => array('layout' => 'sidebar_right', 'sidebar' => 'default_sidebar')); /*-------------------------------------------------------------------------------------------------- Start Coming soon options