function weaverx_end_of_section($who = '') { echo '<hr />'; $name = weaverx_getopt('themename'); if (!$name) { $name = __('Please set theme name on the Advanced Options → Admin Options tab.', 'weaver-xtreme'); } printf(__("%s %s | Options Version: %s | Subtheme: %s\n", 'weaver-xtreme'), WEAVERX_THEMENAME, WEAVERX_VERSION, weaverx_getopt('style_version'), $name); $last = weaverx_getopt('last_option'); if ($last != 'Weaver Xtreme') { ?> <p style="color:red"> <?php _e('Possible Non-Standard Web Host Configuration detected. If your options are not saving correctly, your host may have limited the default number of values that PHP can use for settings. Try saving your settings again, and if this message persists, please contact your host and ask them to "Increase the PHP <em>max_input_vars</em> value for $_POST to at least 600." If that does not fix the issue, please contact Weaver Xtreme support. Diagnostic info: last_option=', 'weaver-xtreme'); echo $last; ?> </p> <?php } if (false && !weaverx_getopt('_hide_subtheme_link')) { ?> <p style="max-width:90%;"><?php weaverx_site('/subthemes/'); ?> <img style="max-width:95%;float:left;margin-right:10px;" src="<?php echo weaverx_relative_url('/assets/images/'); ?> theme-bar.jpg" alt="addons" /> <?php _e('<strong>Discover more premium <br />Weaver Xtreme Subthemes</strong>', 'weaver-xtreme'); ?> </a> </p> <?php } }
function weaverx_form_radio($value) { ?> <tr> <th scope="row" align="right"><?php weaverx_echo_name($value); ?> : </th> <td colspan="2"> <?php $cur_val = weaverx_getopt_default($value['id'], 'black'); foreach ($value['value'] as $option) { $desc = $option['val']; if ($desc == 'none') { $desc = "None"; } else { $icon = weaverx_relative_url('assets/css/icons/search-' . $desc . '.png'); $desc = '<img style="background-color:#ccc;height:24px; width:24px;" src="' . $icon . '" />'; } ?> <input type="radio" name="<?php weaverx_sapi_main_name($value['id']); ?> " value="<?php echo $option['val']; ?> " <?php checked($cur_val, $option['val']); ?> > <?php echo $desc; ?> <?php } ?> <?php echo '<br /><small style="margin-left:5%;">' . $value['info'] . '</small>'; ?> </td> </tr> <?php }
function weaverx_st_pick_theme($list_in) { // output the form to select a file list from weaverx-subthemes directory $list = $list_in; natcasesort($list); $cur_theme = weaverx_getopt('theme_filename'); if (!$cur_theme) { $cur_theme = WEAVERX_DEFAULT_THEME; } // the default theme ?> <form enctype="multipart/form-data" name='pick_theme' method='post'> <strong><?php _e('Click a Radio Button below to select a subtheme:', 'weaver-xtreme'); ?> </strong> <span style="padding-left:100px;"><?php _e('Current theme:', 'weaver-xtreme'); ?> <strong> <?php $cur_addon = weaverx_getopt('addon_name'); if ($cur_addon == '') { echo ucwords(str_replace('-', ' ', $cur_theme)); } else { echo __('Add-on Subtheme: ', 'weaver-xtreme') . ucwords(str_replace('-', ' ', $cur_addon)); $cur_theme = ''; } ?> </strong></span> <br /><br /><span class='submit'><input name="set_subtheme" type="submit" value="<?php _e('Set to Selected Subtheme', 'weaver-xtreme'); ?> " /></span> <small style="color:#b00;"><br /><?php _e('<strong>Note:</strong> Selecting a <em>non-Demo</em> subtheme will change only theme related settings. Options labelled with (♦) will be retained. You can use the Save/Restore tab to save a copy of all your current settings first.', 'weaver-xtreme'); ?> </small><br /><br /> <?php weaverx_nonce_field('set_subtheme'); $thumbs = weaverx_relative_url('/subthemes/'); foreach ($list as $addon) { $name = ucwords(str_replace('-', ' ', $addon)); ?> <div style="float:left; width:200px;"> <label><input type="radio" name="theme_picked" <?php echo 'value="' . $addon . '" ' . ($cur_theme == $addon ? 'checked' : '') . '/> <strong>' . $name . '</strong><br />'; if (!weaverx_getopt('_hide_theme_thumbs')) { echo '<img style="border: 1px solid gray; margin: 5px 0px 10px 0px;" src="' . esc_url($thumbs . $addon . '.jpg') . '" width="150px" height="113px" alt="thumb" /></label></div>' . "\n"; } else { echo "</label></div>\n"; } } if (!weaverx_getopt_checked('_hide_theme_thumbs')) { weaverx_clear_both(); ?> <span class='submit' style='padding-top:6px;'><input name="set_subtheme" type="submit" value="<?php _e('Set to Selected Subtheme', 'weaver-xtreme'); ?> " /></span> <?php } ?> </form> <div style="clear:both;padding-top:6px;"></div> <form enctype="multipart/form-data" name='hide_thumbs_form' method='post'> <?php $hide_msg = weaverx_getopt('_hide_theme_thumbs') ? __('Show Subtheme Thumbnails', 'weaver-xtreme') : __('Hide Subtheme Thumbnails', 'weaver-xtreme'); ?> <input name="hide_thumbs" type="submit" value="<?php echo $hide_msg; ?> " /> <?php weaverx_nonce_field('hide_thumbs'); ?> </form> <div style="clear:both;"></div> <hr /> <?php do_action('weaverx_child_show_extrathemes'); do_action('weaverxplus_admin', 'show_subthemes'); }
/** */ public function render_content() { echo '<span class="customize-control-title">' . esc_html($this->label) . '</span>'; if ('' !== $this->description) { echo '<span class="description customize-control-description">' . $this->description . '</span>'; } $theme_dir = trailingslashit(WP_CONTENT_DIR) . 'themes/' . get_template() . '/subthemes/'; $theme_list = array('ajax', 'antique-ivory', 'appalachian-spring', 'black-and-white', 'blank', 'blue', 'full-width-dark', 'full-width-light', 'ivory-drive', 'kitchen-sink', 'magazine', 'pioneer', 'plain', 'plain-full-width', 'suburban', 'tan-and-gray', 'the-grays', 'transparent-dark', 'transparent-light', 'xenic'); ?> <div class="wvrx-settings-load-subtheme"> <input type="button" class="button" name="wvrx_select_subtheme" value="<?php esc_attr_e('Set to Selected Subtheme', 'weaver-xtreme'); ?> " /> <p class="description customize-control-description"><strong>Click "Set to Selected Subtheme" to pick new selected subtheme.</strong> Selecting a subtheme will <em>reset</em> all existing theme settings. Site settings (♦) will not be changed.</p> <?php $thumbs = weaverx_relative_url('/subthemes/'); foreach ($theme_list as $addon) { $name = ucwords(str_replace('-', ' ', $addon)); ?> <div style="float:left; width:130px;font-size:80%;"> <label><input type="radio" name="subtheme_picked" <?php echo 'value="' . $addon . '" /><strong>' . $name . '</strong><br />'; if (!weaverx_getopt('_hide_theme_thumbs')) { echo '<img style="border: 1px solid gray; margin: 5px 0px 7px 0px;" src="' . esc_url($thumbs . $addon . '.jpg') . '" width="120px" alt="thumb" /></label></div>' . "\n"; } else { echo "</label></div>\n"; } } wp_nonce_field('wvrx_select_subtheme', 'wvrx-upload-subtheme'); ?> </div> <div class="wvrx-uploading"><?php _e('Uploading...', 'weaver-xtreme'); ?> </div> <input type="button" class="button" name="wvrx_select_subtheme" value="<?php esc_attr_e('Set to Selected Subtheme', 'weaver-xtreme'); ?> " /> <p style="font-weight:bold;"> <?php _e('Please remember: these subthemes are only starting points! You can use the Customizer to change virtually any part of these subthemes. You can change colors, sidebar layouts, font family and sizes, borders, spacing - really, everything.', 'weaver-xtreme'); ?> </p> <?php }
/** * Render the description and title for the section. * * displays special message for Weaver Plus * */ public function render_content() { echo '<span class="customize-control-title">' . esc_html($this->label) . '</span>'; if ('' !== $this->description && $this->type != 'HTML') { echo '<span class="description customize-control-description">' . $this->description . '</span>'; } $t_dir = weaverx_relative_url('') . 'assets/images/xplus-link.png'; $wplus = '//shop.weavertheme.com'; $link = "<a style='text-decoration:none;' href='{$wplus}' target='_blank'><img src='{$t_dir}' /></a>"; $link = "<a style='text-decoration:none;font-weight:bold;font-style:italic;background-color:#FFE4B5;padding:1px 4px;' href='{$wplus}' target='_blank'>Weaver Xtreme Plus.</a>"; echo '<span class="description customize-control-description">' . sprintf(__('<strong>★ <em>Add this setting!</em> Get %s</strong>', 'weaver-xtreme'), $link) . '</span>'; }
function do_weaverx_admin_mainopts() { if (!has_action('weaverx_admin_mainopts')) { echo '<br /><h2>'; echo sprintf(__('Please install the %s plugin to enable <em>Main and Advanced Options</em>.', 'weaver-xtreme'), '<a href="//wordpress.org/plugins/weaverx-theme-support" target="_blank">Weaver Xtreme Theme Support</a>'); echo '</h3><p>'; _e('The <em>Weaver Xtreme Theme Support Plugin</em> provides a full set of theme options, including pre-defined subthemes, and the complete legacy options interface which gives you even more ways to customize your site design. Please open the <em>Appearance → Recommended Plugins</em> menu or go to WordPress.com to install this plugin.', 'weaver-xtreme'); echo '</p>'; $t_dir = weaverx_relative_url('') . 'assets/images/legacy-options.jpg'; echo '<img style="margin-left:5%;" src="' . $t_dir . '" />'; } else { do_action('weaverx_admin_mainopts'); } }
function weaverx_st_pick_theme($list_in) { // output the form to select a file list from weaverx-subthemes directory $list = $list_in; natcasesort($list); $cur_theme = weaverx_getopt('theme_filename'); if (!$cur_theme) { $cur_theme = WEAVERX_DEFAULT_THEME; } // the default theme ?> <form enctype="multipart/form-data" name='pick_theme' method='post' onSubmit="return confirm('<?php _e('Are you sure you want select a new theme?\\r\\n\\r\\nSelecting a new subtheme will overwrite your existing theme settings. You should save your existing settings on the Save/Restore menu if you have made changes.', 'weaver-xtreme'); ?> ');" > <strong><?php _e('Click a Radio Button below to select a subtheme:', 'weaver-xtreme'); ?> </strong> <span style="padding-left:100px;"><?php _e('Current theme:', 'weaver-xtreme'); ?> <strong> <?php $cur_addon = weaverx_getopt('addon_name'); if ($cur_addon == '') { echo ucwords(str_replace('-', ' ', $cur_theme)); } else { echo __('Add-on Subtheme: ', 'weaver-xtreme') . ucwords(str_replace('-', ' ', $cur_addon)); $cur_theme = ''; } ?> </strong></span> <br /><br /> <?php //weaverx_confirm_select_theme(); ?> <input class="button-primary" name="set_subtheme" type="submit" value="<?php _e('Set to Selected Subtheme', 'weaver-xtreme'); ?> " /> <p style="color:#b00;font-weight:bold;font-size:120%"><br /><?php _e('<em>Note:</em> Before switching to any subtheme, you must Save and download a copy of your settings using the Save / Restore page, in order to be able to go back to them if required.', 'weaver-xtreme'); ?> </p> <?php weaverx_nonce_field('set_subtheme'); $thumbs = weaverx_relative_url('subthemes/'); foreach ($list as $addon) { $name = ucwords(str_replace('-', ' ', $addon)); ?> <div style="float:left; width:200px;"> <label><input type="radio" name="theme_picked" <?php echo 'value="' . $addon . '" ' . ($cur_theme == $addon ? 'checked' : '') . '/> <strong>' . $name . '</strong><br />'; if (!weaverx_getopt('_hide_theme_thumbs')) { echo '<img style="border: 1px solid gray; margin: 5px 0px 10px 0px;" src="' . esc_url($thumbs . $addon . '.jpg') . '" width="150px" height="113px" alt="thumb" /></label></div>' . "\n"; } else { echo "</label></div>\n"; } } if (!weaverx_getopt_checked('_hide_theme_thumbs')) { weaverx_clear_both(); ?> <span class='submit' style='padding-top:6px;'><input class="button-primary" name="set_subtheme" type="submit" value="<?php _e('Set to Selected Subtheme', 'weaver-xtreme'); ?> " /></span> <?php } ?> </form> <div style="clear:both;padding-top:6px;"></div> <form enctype="multipart/form-data" name='hide_thumbs_form' method='post'> <?php $hide_msg = weaverx_getopt('_hide_theme_thumbs') ? __('Show Subtheme Thumbnails', 'weaver-xtreme') : __('Hide Subtheme Thumbnails', 'weaver-xtreme'); ?> <input class="button-primary" name="hide_thumbs" type="submit" value="<?php echo $hide_msg; ?> " /> <?php weaverx_nonce_field('hide_thumbs'); ?> </form> <div style="clear:both;"></div> <hr /> <?php do_action('weaverx_child_show_extrathemes'); do_action('weaverxplus_admin', 'show_subthemes'); }
function weaverx_compact_link($check = '') { if ($check == 'check' && !weaverx_is_checked_post_opt('_pp_post_add_link')) { return; } $link_img = weaverx_relative_url('') . 'assets/images/expand.png'; ?> <div><a href="<?php esc_url(the_permalink()); ?> " title="<?php the_title_attribute('echo=1'); ?> " rel="bookmark"> <img src="<?php echo esc_url($link_img); ?> " /></a></div> <?php }
function weaverx_output_style($sout) { /* This outputs the CSS overrides. It will output to a file pointer, so it can write to a .css file saved in the user's upload directory - just like the saved style .wvr files. It is included via a standard css include. It needs to be loaded only for the admin page. */ global $wvrx_css_plus; $wvrx_css_plus = ''; weaverx_f_write($sout, sprintf("/* Weaver Xtreme styles - Version %s */\n", weaverx_getopt('style_version'))); // =========================== LINKS =============================== // Important. Links must come before any other rules that might define a tag - such as the menu bars, so just // put them here, near the top. weaverx_put_link($sout, 'link', 'a, .wrapper a', 'a:hover, .wrapper a:hover'); weaverx_put_link($sout, 'contentlink', '.content a', '.content a:hover'); weaverx_put_link($sout, 'ilink', '.wrapper .entry-meta a, .wrapper .entry-utility a', '.wrapper .entry-meta a:hover,.wrapper .entry-utility a:hover'); weaverx_put_link($sout, 'wlink', '.wrapper .widget a', '.wrapper .widget a:hover'); weaverx_put_link($sout, 'ibarlink', '#infobar a', '#infobar a:hover'); weaverx_put_link($sout, 'footerlink', '.colophon a', '.colophon a:hover'); // ========================= GENERAL APPEARANCE =============================== $b_c = weaverx_getopt_default('border_color', '#222'); //+ $b_w = weaverx_getopt_default('border_width_int', 1); $b_s = weaverx_getopt_default('border_style', 'solid'); $menus = array('m_primary' => '.menu-primary', 'm_secondary' => '.menu-secondary', 'm_extra' => '.menu-extra'); if ($b_c != '#222' || $b_w != 1 || $b_s != 'solid') { weaverx_f_write($sout, sprintf(".border {border:%dpx %s %s;}.border-bottom{border-bottom:%dpx %s %s;}\n", $b_w, $b_s, $b_c, $b_w, $b_s, $b_c)); } foreach ($menus as $id => $tag) { if (weaverx_getopt("{$id}_sub_border")) { weaverx_f_write($sout, sprintf(".is-desktop {$tag} ul ul,.is-desktop {$tag} ul.mega-menu li {border:%dpx %s %s;}\n.is-desktop {$tag} ul ul.mega-menu{border:none;}\n", $b_w, $b_s, $b_c)); } } /* rounded_corners */ $r = 8; $rm = 6; // rm for comments section $r = weaverx_getopt_default('rounded_corners_radius', 8); if ($r != 8) { if ($r >= 8) { $rm = (int) (0.75 * $r); } else { $rm = $r; } // It's time: no -moz or -webkit $rounded = '.rounded,.rounded-all,.rounded-custom{-moz-border-radius:8px !important; -webkit-border-radius:8px !important;border-radius:8px !important;} .rounded-top{-moz-border-radius-topleft:8px; -moz-border-radius-topright:8px;-webkit-border-top-left-radius:8px; -webkit-border-top-right-radius:8px;border-top-left-radius:8px; border-top-right-radius: 8px;} .rounded-bottom {-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-left-radius:8px; -webkit-border-bottom-right-radius:8px;border-bottom-left-radius:8px; border-bottom-right-radius:8px;} .rounded-left{-moz-border-radius-topleft:8px;-moz-border-radius-bottomleft:8px;-webkit-border-top-left-radius:8px; -webkit-border-bottom-left-radius:8px;border-top-left-radius:8px;border-bottom-left-radius:8px;} .rounded-right{-moz-border-radius-topright:8px;-moz-border-radius-bottomright:8px;-webkit-border-top-right-radius:8px; -webkit-border-bottom-right-radius:8px;border-top-right-radius:8px;border-bottom-right-radius:8px;}'; weaverx_f_write($sout, str_replace('8', $rm, $rounded) . "\n"); } foreach ($menus as $id => $tag) { if (weaverx_getopt("{$id}_sub_rounded")) { // 3 kinds of rounding: whole box + hover, top sub-item, bottom sub-item $round_sub = str_replace('8', $r, "{-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;z-index:90;"); $menu = ".is-desktop {$tag} ul.sub-menu,.is-desktop {$tag} ul.children"; $mega = ".is-desktop {$tag} ul.mega-menu li"; $pad = (int) ($r - $r * 0.25); // pad it to avoid anchor bg from overwriting rounding $bg = weaverx_getopt("{$id}_sub_bgcolor"); if ($bg == '') { $bg = 'transparent'; } $round_end = "padding-top:{$pad}px;padding-bottom:{$pad}px;background-color:{$bg};}"; weaverx_f_write($sout, $menu . $round_sub . $round_end); weaverx_f_write($sout, $mega . $round_sub . "}\n"); } } /* fadebody_bg */ if (weaverx_getopt('fadebody_bg')) { weaverx_f_write($sout, sprintf("body {background-image: url(%s); background-attachment: scroll; background-repeat: repeat-x;}\n", weaverx_relative_url('assets/images/gr.png'))); } // ========================= LAYOUT / SIDEBAR AREAS =============================== if (($themew = weaverx_getopt_default('theme_width_int', 940)) != 940) { weaverx_f_write($sout, sprintf("#wrapper{max-width:%dpx;}\n", $themew)); } // =========================== HEADER OPTIONS =============================== weaverx_css_style_val($sout, '#site-title', '{max-width:%.5f%%;}', 'site_title_max_w'); weaverx_css_style_val($sout, '#site-tagline', '{max-width:%.5f%%;}', 'tagline_max_w'); /* Site Title/Description Site Title' => 'title_color' Title Position => 'site_title_position_xy' Move Title over Header Image => 'title_over_image' Site Description => 'desc_color' Description Position => 'tagline_xy' Header Extra HTML => 'header_html' */ $tx = weaverx_getopt_default('site_title_position_xy_X', 7); $ty = weaverx_getopt_default('site_title_position_xy_Y', 0); // new title margins if ($tx != 7 || $ty != 0) { if (is_rtl()) { weaverx_f_write($sout, sprintf("#site-title{margin-right:%.5f%% !important;margin-top:%.5f%% !important;}\n", $tx, $ty)); } else { weaverx_f_write($sout, sprintf("#site-title{margin-left:%.5f%% !important;margin-top:%.5f%% !important;}\n", $tx, $ty)); } } $tx = weaverx_getopt_default('tagline_xy_X', 10); $ty = weaverx_getopt_default('tagline_xy_Y', 0); // new title margins if ($tx != 10 || $ty != 0) { if (is_rtl()) { weaverx_f_write($sout, sprintf("#site-tagline{ margin-right:%.5f%% !important; margin-top:%.5f%% !important;}\n", $tx, $ty)); } else { weaverx_f_write($sout, sprintf("#site-tagline{ margin-left:%.5f%% !important; margin-top:%.5f%% !important;}\n", $tx, $ty)); } } $align = weaverx_getopt_default('header_image_align', 'float-left'); // alignment if (weaverx_getopt('link_site_image') && $align != 'center') { // normally, we use display:block on the image to make it align, etc, but that makes the link // extend over the whole column... So, we will use alternate layout for linked left/right align, and let center just be wrong. if ($align == 'float-left') { weaverx_f_write($sout, '#branding #header-image img{display:inline-block;float:left;}'); } else { weaverx_f_write($sout, '#branding #header-image img{display:inline-block;float:right;}'); } } else { if (($align = weaverx_getopt_default('header_image_align', 'float-left')) != 'float-left') { if ($align == 'center') { weaverx_f_write($sout, '#branding #header-image img{margin-left:auto;margin-right:auto;}'); } else { weaverx_f_write($sout, '#branding #header-image img{margin-left:auto;margin-right:0;}'); } } } if (weaverx_getopt('header_actual_size')) { weaverx_f_write($sout, '#branding #header-image img,html.ie8 #branding #header-image img {width:auto;}'); } if ($val = weaverx_getopt('header_image_max_width_dec')) { weaverx_f_write($sout, sprintf("#branding #header-image img{max-width:%.5f%%;}\n", $val)); weaverx_f_write($sout, sprintf("html.ie8 #branding #header-image img{width:%.5f%%;}\n", $val)); } if (($align = weaverx_getopt_default('header_html_align', 'float-left')) == 'center') { //$hwidth = weaverx_getopt_default( 'header_html_width_int', '100'); //$lm = (100.0 - $hwidth ) / 2.0; //weaverx_f_write($sout, sprintf("#header-html {margin-left:%.5f%%;}\n",$lm )); weaverx_f_write($sout, "#header-html {display:block !important;}\n"); } if (($align = weaverx_getopt_default('footer_html_align', 'float-left')) == 'center') { /* $hwidth = weaverx_getopt_default( 'footer_html_width_int', '100'); $lm = (100.0 - $hwidth ) / 2.0; weaverx_f_write($sout, sprintf("#footer-html {margin-left:%.5f%%;}\n",$lm )); */ weaverx_f_write($sout, "#gootrt-html {display:block !important;}\n"); } if (weaverx_getopt_default('header_html_center_content')) { weaverx_f_write($sout, "#header-html {text-align:center;}\n"); } if (weaverx_getopt_default('footer_html_center_content')) { weaverx_f_write($sout, "#footer-html {text-align:center;}\n"); } // =========================== MENU OPTIONS =============================== /* text_color = 0.213 * this.rgb[0] + 0.715 * this.rgb[1] + 0.072 * this.rgb[2] < 0.5 ? '#FFF' : '#000'; */ $cur_page = weaverx_getopt('menubar_curpage_noancestors') ? '.weaverx-theme-menu .current_page_item > a,.weaverx-theme-menu .current-menu-item > a,.weaverx-theme-menu .current-cat > a' : '.weaverx-theme-menu .current_page_item > a,.weaverx-theme-menu .current-menu-item > a,.weaverx-theme-menu .current-cat > a,.weaverx-theme-menu .current_page_ancestor > a,' . '.weaverx-theme-menu .current-category-ancestor > a,.weaverx-theme-menu .current-menu-ancestor > a,.weaverx-theme-menu .current-menu-parent > a,.weaverx-theme-menu .current-category-parent > a'; weaverx_put_color($sout, 'menubar_curpage_color', $cur_page, true); // menubar_curpage_color weaverx_put_bgcolor($sout, 'menubar_curpage_bgcolor', $cur_page, true); weaverx_put_rule_if_checked($sout, 'menubar_curpage_em', $cur_page . '{font-style:italic}'); // menubar_curpage_em weaverx_put_rule_if_checked($sout, 'menubar_curpage_bold', $cur_page . '{font-weight:bold}'); // =========================== CONTENT AREAS =============================== // Images if (weaverx_getopt('restrict_img_border')) { $img_tag = '.comment-content img[height],.container img[class*="align"],.container img[class*="wp-image-"],.container img[class*="attachment-"],.container img.featured-image,.container img.avatar,.colophon img[class*="align"],.colophon img[class*="wp-image-"],.colophon img[class*="attachment-"],.colophon img.featured-image,.colophon img.avatar'; } else { $img_tag = '.container img, .colophon img'; } weaverx_css_style_val($sout, $img_tag, '{padding:%dpx;}', 'media_lib_border_int'); $img_w = weaverx_getopt('media_lib_border_int'); if ($img_w > 3) { $half = $img_w / 2 + 1; $small_border_tag = '.container .gallery-icon img,.container .gallery-thumb img,#content img.gallery-thumb,#content img.avatar'; weaverx_f_write($sout, sprintf("{$small_border_tag}{padding:{$half}px;}\n")); // make the thumbs smaller } if (weaverx_getopt_checked('show_img_shadows')) { weaverx_f_write($sout, $img_tag . '{-webkit-box-shadow: 0 0 4px 2px rgba(0,0,0,0.25);-moz-box-shadow: 0 0 4px 2px rgba(0,0,0,0.25);box-shadow: 0 0 4px 2px rgba(0,0,0,0.25);}' . "\n"); } weaverx_put_bgcolor($sout, 'media_lib_border_color', $img_tag); $val = weaverx_getopt('contentlist_bullet'); if ($val != '' && $val != 'disc') { weaverx_f_write($sout, sprintf("#content ul {list-style-type:%s;}\n", $val)); } weaverx_css_style_val($sout, '.entry-summary,.entry-content', '{padding-top:%.5fem;}', 'space_after_title_dec'); weaverx_css_style_val($sout, '#content p,#content ul,#content ol', '{margin-bottom:%.5fem;}', 'content_p_list_dec'); if (weaverx_getopt('hyphenate')) { weaverx_f_write($sout, '#content{-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto;}'); } /* Comments */ weaverx_put_rule_if_checked($sout, 'form_allowed_tags', '#commentform .form-allowed-tags {display:block;}'); $b_c = weaverx_getopt('border_color'); // if (!$b_c) { $b_c = '#222'; } $b_w = weaverx_getopt('border_width_int'); // if (!$b_w) { $b_w = 1; } weaverx_put_rule_if_checked($sout, 'show_comment_borders', ".commentlist li.comment,#respond,.commentlist li.comment .comment-author img.avatar,.commentlist .comment.bypostauthor{border:{$b_w}px solid {$b_c};}.commentlist li.comment .comment-meta{border-bottom:1px solid {$b_c};}"); weaverx_put_rule_if_checked($sout, 'hide_comment_bubble', '#comments-title h3{background-image:none;padding-left:0px;}'); weaverx_put_rule_if_checked($sout, 'hide_comment_hr', 'hr.comments-hr {display:none;}'); weaverx_put_color($sout, 'comment_headings_color', '#comments-title h3, #comments-title h4, #respond h3'); weaverx_put_bgcolor($sout, 'comment_content_bgcolor', '.commentlist li.comment, #respond'); weaverx_put_bgcolor($sout, 'comment_submit_bgcolor', '#respond input#submit'); /* weaverx_tables */ $table = weaverx_getopt('weaverx_tables'); if ($table == 'wide') { // make backward compatible with 1.4 and before when Twenty Ten was default weaverx_f_write($sout, sprintf("#content table {border: 1px solid #e7e7e7;margin: 0 -1px 24px 0;text-align: left;width: 100%%;}\n#content tr th, #content thead th {color: #888;font-size: 12px;font-weight: bold;line-height: 18px;padding: 9px 24px;}\n#content tr td {border-style:none; border-top: 1px solid #e7e7e7; padding: 6px 24px;}\n#content tr.odd td {background: rgba(0,0,0,0.1);}\n")); //weaverx_f_write($sout,"#content tr.odd td{background:transparent;}\n"); } elseif ($table == 'bold') { weaverx_f_write($sout, sprintf("#content table {border: 2px solid #888;}\n#content tr th, #content thead th {font-weight: bold;}\n#content tr td {border: 1px solid #888;}\n")); } elseif ($table == 'noborders') { weaverx_f_write($sout, sprintf("#content table {border-style:none;}\n#content tr th, #content thead th {font-weight: bold;border-bottom: 1px solid #888;background-color:transparent;}\n#content tr td {border-style:none;}\n")); } elseif ($table == 'fullwidth') { weaverx_f_write($sout, sprintf("#content table {width:100%%;}\n#content tr th, #content thead th {font-weight:bold;}\n")); } elseif ($table == 'plain') { weaverx_f_write($sout, sprintf("#content table {border: 1px solid #888;text-align:left;margin: 0 0 0 0;width:auto;}\n#content tr th, #content thead th {color: inherit;background:none;font-weight:normal;line-height:normal;padding:4px;}\n#content tr td {border: 1px solid #888; padding:4px;}\n")); } /* caption_color */ weaverx_put_color($sout, 'caption_color', '.wp-caption p.wp-caption-text, #content .gallery .gallery-caption,.entry-attachment .entry-caption'); // =========================== POST SPECIFIC AREAS =============================== weaverx_put_rule_if_checked($sout, 'show_comments_closed', '.nocomments {display:block;}'); // single/post navigation links weaverx_put_rule_if_checked($sout, 'nav_show_first', '#nav-above{display:block;}'); // put this one first, so hide can override weaverx_put_rule_if_checked($sout, 'nav_hide_above', '#nav-above,.paged #nav-above{display:none;margin:0;}'); weaverx_put_rule_if_checked($sout, 'nav_hide_below', '#nav-below{display:none;margin:0;}'); if (weaverx_getopt('single_nav_style') == 'hide' || weaverx_getopt_checked('single_nav_hide_above')) { weaverx_f_write($sout, ".single #nav-above{display:none;margin:0;}\n"); } if (weaverx_getopt('single_nav_style') == 'hide' || weaverx_getopt_checked('single_nav_hide_below')) { weaverx_f_write($sout, ".single #nav-below{display:none;margin:0;}\n"); } $nav = weaverx_getopt('nav_style'); // paged can take more than 50% if ($nav == 'paged_left') { weaverx_f_write($sout, ".nav-previous {width:95%;}\n"); } if ($nav == 'paged_right') { weaverx_f_write($sout, ".nav-next {width:95%;}\n"); } weaverx_put_color($sout, 'post_icons_color', '.entry-meta-gicons .entry-date:before,.entry-meta-gicons .by-author:before,.entry-meta-gicons .cat-links:before,.entry-meta-gicons .tag-links:before,.entry-meta-gicons .comments-link:before,.entry-meta-gicons .permalink-icon:before'); weaverx_put_rule_if_checked($sout, 'post_hide_single_author', '.single-author .entry-meta .by-author {display:none;}'); if (($val = weaverx_getopt_default('post_avatar_int', 28)) != 28) { weaverx_f_write($sout, '.post-avatar img {max-width:' . $val . "px;}\n"); } // ============================== WIDGET AREAS =================================== $val = weaverx_getopt('widgetlist_bullet'); if ($val != '' && $val != 'disc') { weaverx_f_write($sout, sprintf(".widget ul {list-style-type:%s;}\n", $val)); } // ================================== FONTS ===================================== // 0.0625 assumes standard default font size of 16 $font_size = weaverx_getopt('site_fontsize_int'); if ($font_size) { weaverx_f_write($sout, sprintf("body{font-size:%.5fem;}\n", $font_size * 0.0625)); } $font_size = weaverx_getopt('site_fontsize_tablet_int'); if ($font_size) { weaverx_f_write($sout, sprintf('body.is-smalltablet{font-size:%.5fem;}', $font_size * 0.0625)); } $font_size = weaverx_getopt('site_fontsize_phone_int'); if ($font_size) { weaverx_f_write($sout, sprintf('body.is-phone{font-size:%.5fem;}', $font_size * 0.0625)); } if ($site_h = weaverx_getopt('site_line_height_dec')) { weaverx_f_write($sout, sprintf('body{line-height:%.5f;}', $site_h)); weaverx_f_write($sout, sprintf('.widget-area{line-height:%.5f;}', $site_h * 0.85)); } $space = weaverx_getopt('font_letter_spacing_global_dec'); if ($space && $space != 0) { weaverx_f_write($sout, sprintf("body{letter-spacing:%.5fem;}\n", $space)); } $space = weaverx_getopt('font_letter_spacing_global_dec'); if ($space && $space != 0) { weaverx_f_write($sout, sprintf("body{word-spacing:%.5fem;}\n", $space)); } // ============================== CUSTOM OPTIONS ================================= if ($val = weaverx_getopt('custom_fontsize_a')) { weaverx_f_write($sout, '.customA-font-size{font-size:' . $val . 'em;}'); weaverx_f_write($sout, sprintf('.customA-font-size-title{font-size:%.5fem;}', $val * 1.5)); } if ($val = weaverx_getopt('custom_fontsize_b')) { weaverx_f_write($sout, '.customB-font-size{font-size:' . $val . 'em;}'); weaverx_f_write($sout, sprintf('.customB-font-size-title{font-size:%.5fem;}', $val * 1.5)); } if ($val = weaverx_getopt('custom_shadow')) { weaverx_f_write($sout, '.shadow-custom ' . weaverx_fix_braces($val)); } // ================================ AREAS ======================================== weaverx_put_bgcolor($sout, 'body_bgcolor', 'body'); // start with the body colors/css+ weaverx_put_bgcolor($sout, 'title_tagline_bgcolor', '#title-tagline'); $menu_bars = array('m_primary' => '.menu-primary .wvrx-menu-container', 'm_secondary' => '.menu-secondary .wvrx-menu-container', 'm_extra' => '.menu-extra .wvrx-menu-container', 'm_primary_sub' => '.menu-primary .wvrx-menu ul li a,.menu-primary .wvrx-menu ul.mega-menu li', 'm_secondary_sub' => '.menu-secondary .wvrx-menu ul li a,.menu-secondary .wvrx-menu ul.mega-menu li', 'm_extra_sub' => '.menu-extra .wvrx-menu ul li a,.menu-extra .wvrx-menu ul.mega-menu li'); $menu_links_bg = array('m_primary' => '.menu-primary .wvrx-menu > li > a', 'm_secondary' => '.menu-secondary .wvrx-menu > li > a', 'm_extra' => '.menu-extra .wvrx-menu > li > a'); $menu_links = array('m_primary' => '.menu-primary .wvrx-menu > li > a', 'm_secondary' => '.menu-secondary .wvrx-menu > li > a', 'm_extra' => '.menu-extra .wvrx-menu > li > a', 'm_primary_sub' => '.menu-primary .wvrx-menu ul li a', 'm_secondary_sub' => '.menu-secondary .wvrx-menu ul li a', 'm_extra_sub' => '.menu-extra .wvrx-menu ul li a'); $menu_detail = array('m_primary' => '.menu-primary', 'm_secondary' => '.menu-secondary', 'm_extra' => '.menu-extra'); // =Menus ------------------------------------------------------------ foreach ($menu_bars as $id => $tag) { weaverx_put_bgcolor($sout, $id . '_bgcolor', $tag); weaverx_put_color($sout, $id . '_color', $tag); } foreach ($menu_links_bg as $id => $tag) { weaverx_put_bgcolor($sout, $id . '_link_bgcolor', $tag); } foreach ($menu_links as $id => $tag) { weaverx_put_color($sout, $id . '_color', $tag); weaverx_put_color($sout, $id . '_hover_color', $tag . ':hover', true); if (weaverx_getopt('m_retain_hover') && strpos($id, '_sub') === false) { $rule = str_replace('> li', 'li:hover', $tag); weaverx_put_bgcolor($sout, $id . '_hover_bgcolor', $rule, true); } else { weaverx_put_bgcolor($sout, $id . '_hover_bgcolor', $tag . ':hover', true); // important to override current item bg } } foreach ($menu_detail as $id => $tag) { weaverx_put_color($sout, $id . '_color', $tag . ' .menu-toggle-button'); weaverx_put_color($sout, $id . '_html_color', $tag . ' .wvrx-menu-html'); // Extra menu HTML Left/Right $val = weaverx_getopt($id . '_html_margin_dec'); if ($val) { weaverx_f_write($sout, sprintf($tag . " .wvrx-menu-html{margin-top:%.5fem;}\n", $val)); } else { $font_size = weaverx_getopt($id . '_font_size'); // generate new top margin based on font_size switch ($font_size) { case 'xxs-font-size': weaverx_f_write($sout, $tag . " .wvrx-menu-html{margin-top:.375em;}\n"); break; case 'xs-font-size': weaverx_f_write($sout, $tag . " .wvrx-menu-html{margin-top:.425em;}\n"); break; case 's-font-size': weaverx_f_write($sout, $tag . " .wvrx-menu-html{margin-top:.5em;}\n"); break; case 'l-font-size': weaverx_f_write($sout, $tag . " .wvrx-menu-html{margin-top:.425em;}\n"); break; case 'xl-font-size': weaverx_f_write($sout, $tag . " .wvrx-menu-html{margin-top:.425em;}\n"); break; case 'xxl-font-size': weaverx_f_write($sout, $tag . " .wvrx-menu-html{margin-top:.425em;}\n"); break; default: break; } } // padding $pad = weaverx_getopt($id . '_menu_pad_dec'); $dcolor = weaverx_getopt($id . '_dividers_color'); $rpad = weaverx_getopt($id . '_right_padding_dec'); $hide_arrows = weaverx_getopt($id . '_hide_arrows'); weaverx_f_write($sout, "@media(min-width:768px) {\n"); // following are really .is-desktop. Note last align rule has closing } if ($pad != '') { weaverx_f_write($sout, sprintf("{$tag} .wvrx-menu a{padding-top:%.5fem;padding-bottom:%.5fem;}\n", $pad, $pad)); if ($pad > 1.9) { // arrows need adjustments - these are for Genericons weaverx_f_write($sout, sprintf("{$tag} .menu-arrows .toggle-submenu:after{top:%.5fem;}\n", $pad + 1.2)); } else { if ($pad > 0.6) { weaverx_f_write($sout, sprintf("{$tag} .menu-arrows .toggle-submenu:after{top:%.5fem;}\n", $pad + 0.75)); } else { if ($pad < 0.6) { weaverx_f_write($sout, sprintf("{$tag} .menu-arrows .toggle-submenu:after{top:%.5fem;}\n", $pad + 0.5)); } } } } // dividers if ($dcolor != '') { weaverx_f_write($sout, "{$tag} .wvrx-menu a{border-right:1px solid {$dcolor};}\n"); weaverx_f_write($sout, "{$tag} ul.wvrx-menu > li:first-child {border-left:1px solid {$dcolor};}\n"); // only desktop? weaverx_f_write($sout, "{$tag} .wvrx-menu ul > li:first-child{border-top:1px solid {$dcolor};}\n"); weaverx_f_write($sout, "{$tag} .wvrx-menu ul a {border-top:none;border-left:none;border-right:none;border-bottom:1px solid {$dcolor};}\n"); } // menu padding if ($rpad != '') { $rpad_arrow = $rpad + 1.5; weaverx_f_write($sout, "{$tag} .wvrx-menu-container li a{padding-right:{$rpad}em;}\n"); weaverx_f_write($sout, "{$tag} .menu-hover.menu-arrows .has-submenu > a{padding-right:{$rpad_arrow}em;}\n"); weaverx_f_write($sout, "{$tag} .menu-arrows.menu-hover .toggle-submenu{margin-right:{$rpad}em;}\n"); } // menu margins $mtop = weaverx_getopt($id . '_top_margin_dec'); $mbot = weaverx_getopt($id . '_bottom_margin_dec'); if ($mtop != '') { weaverx_f_write($sout, "{$tag} .wvrx-menu-container{margin-top:{$mtop}px;}\n"); } if ($mbot != '') { weaverx_f_write($sout, "{$tag} .wvrx-menu-container{margin-bottom:{$mbottom}px;}\n"); } // Menu Arrows if ($hide_arrows) { weaverx_f_write($sout, "{$tag} .menu-arrows .toggle-submenu:after{content:'';display:none;}\n"); //.is-deskotp {$tag} .wvrx-menu a span.sub-arrow:after{display:none;}\n"); if ($rpad == '') { weaverx_f_write($sout, "{$tag} .menu-hover.menu-arrows .has-submenu > a {padding-right:0.75em;}\n"); } weaverx_f_write($sout, "{$tag} .wvrx-menu a span.sub-arrow:after{display:none;}\n"); } // special case - generate a .wvrx-menu text align for main menus to get rid of initial menu jumping $align = weaverx_getopt_default("{$id}_align", 'left'); $lh = ''; if ($align == 'center') { // compensate for centered display:inline-block $lh = 'line-height:0;'; } weaverx_f_write($sout, "{$tag} .wvrx-menu,{$tag} .wvrx-menu-container{text-align:{$align};{$lh}}\n}\n"); // NOTE! Has @media close } $color = weaverx_getopt($id . '_color'); if ($color) { weaverx_f_write($sout, sprintf("{$tag} .menu-arrows .toggle-submenu:after{color:{$color};}\n")); weaverx_f_write($sout, sprintf("{$tag} .menu-arrows ul .toggle-submenu:after{color:{$color};}\n")); weaverx_f_write($sout, sprintf("{$tag} .menu-arrows.is-mobile-menu.menu-arrows ul a .toggle-submenu:after{color:{$color};}\n")); } $color = weaverx_getopt("{$id}_sub_color"); // sub-menu arrow takes special handling to override if ($color) { weaverx_f_write($sout, sprintf("{$tag} .menu-arrows ul .toggle-submenu:after{color:{$color};}\n")); } // alternative mobile menu arrow clickable weaverx_put_bgcolor($sout, $id . '_clickable_bgcolor', "{$tag} .is-mobile-menu.menu-arrows .toggle-submenu"); } // End of Menus // =Search ------------------------------------------------------------ if (($val = weaverx_getopt_default('search_icon', 'gray-bg')) != 'gray-bg') { $icon = weaverx_relative_url('assets/css/icons/search-' . $val . '.png'); weaverx_f_write($sout, '.search-field {background-image: url(' . $icon . ");}\n"); } $search_bg = weaverx_getopt('search_bgcolor'); if ($search_bg) { weaverx_put_bgcolor($sout, 'search_bgcolor', '.search-field'); // general search bg weaverx_f_write($sout, '#header-search .search-field:focus{background-color:' . $search_bg . ";}\n"); } // End of Menus // ================================ MARGINS/PADDING/SMART WIDGETS =================================== /* * .l-content {width:100%;} .l-content-m {width:98%;margin-left:1%;margin-right:1%;} .l-sb-left, .l-sb-right, .l-sb-left-split, .l-sb-right-split {width:25%;} .l-sb-left-lm, .l-sb-right-lm, .l-sb-left-split-lm, .l-sb-right-split-lm {width:24%;margin-left:1%;} .l-sb-left-rm, .l-sb-right-rm, .l-sb-left-split-rm, .l-sb-right-split-rm {width:24%;margin-right:1%;} .l-widget-area-top, .l-widget-area-bottom {width:100%;} */ // smart -lm, -rm, -m : value is 'smart_margin_int' $smart = weaverx_getopt_default('smart_margin_int', 1); if ($smart > 25) { $smart = 1; } // some sanity check if ($smart != 1) { for ($i = 2; $i <= 8; $i++) { $w = 99.9999 / $i - $smart + $smart / $i; // 99.9999 just a little rounding fudge factor */ weaverx_f_write($sout, sprintf(".is-desktop .per-row-%d-m{width:%.5f%%;}", $i, $w)); } weaverx_f_write($sout, sprintf(".is-smalltablet .per-row-2-m,.is-smalltablet .per-row-3-m,.is-smalltablet .per-row-4-m,.is-smalltablet .per-row-5-m,.is-smalltablet .per-row-6-m,.is-smalltablet .per-row-7-m,.is-smalltablet .per-row-8-m{width:%.5f%%;}", 49.999 - $smart / 2.0)); weaverx_f_write($sout, "\n"); weaverx_f_write($sout, ".is-smalltablet .m-widget-smart-rm aside,.widget-smart-rm aside,.ie8 .smart-rm{margin-right:{$smart}%;}\n"); } weaverx_sidebar_style($sout); // generate sidebar style /* _bgcolor, _color : MUST BE AFTER OTHER AREA OPTIONS BECAUSE OF CSS+ */ $sb_areas = array('primary' => '#primary-widget-area', 'alt:primary' => '.widget-area-primary', 'secondary' => '#secondary-widget-area', 'alt:secondary' => '.widget-area-secondary', 'top' => '.widget-area-top', 'bottom' => '.widget-area-bottom', 'header' => '#header', 'header_html' => '#header-html', 'header_sb' => '#header-widget-area', 'alt:header_sb' => '.widget-area-header', 'footer' => '#colophon', 'footer_html' => '#footer-html', 'footer_sb' => '#footer-widget-area', 'alt:footer_sb' => '.widget-area-footer', 'content' => '#content', 'container' => '#container', 'infobar' => '#infobar', 'wrapper' => '#wrapper', 'post' => '.post-area', 'widget' => '.widget'); foreach ($sb_areas as $area => $tag) { $id = str_replace('alt:', '', $area); // allow double rules weaverx_put_bgcolor($sout, $id . '_bgcolor', $tag); weaverx_put_color($sout, $id . '_color', $tag); if ($area == 'content' || $area == 'post') { // #content is % instead of px weaverx_css_style_val($sout, $tag, '{padding-left:%.5f%%;}', $id . '_padding_L'); weaverx_css_style_val($sout, $tag, '{padding-right:%.5f%%;}', $id . '_padding_R'); } else { weaverx_css_style_val($sout, $tag, '{padding-left:%dpx;}', $id . '_padding_L'); weaverx_css_style_val($sout, $tag, '{padding-right:%dpx;}', $id . '_padding_R'); } weaverx_css_style_val($sout, $tag, '{padding-top:%dpx;}', $id . '_padding_T'); weaverx_css_style_val($sout, $tag, '{padding-bottom:%dpx;}', $id . '_padding_B'); weaverx_css_style_val($sout, $tag, '{margin-top:%dpx;}', $id . '_margin_T'); weaverx_css_style_val($sout, $tag, '{margin-bottom:%dpx;}', $id . '_margin_B'); } $max_w_areas = array('header' => '#header', 'footer' => '#colophon', 'container' => '#container', 'm_primary' => '.menu-primary', 'm_secondary' => '.menu-secondary', 'm_extra' => '.menu-extra'); foreach ($max_w_areas as $id => $tag) { $w = weaverx_getopt($id . '_max_width_int'); if ($w) { weaverx_f_write($sout, "{$tag}" . "{max-width:{$w}px;}\n"); } if ($xbg = weaverx_getopt($id . '_extend_bgcolor')) { $cname = "{$tag}"; weaverx_f_write($sout, "{$cname}{position:relative;overflow:visible;}\n{$cname}:before{content:'';position:absolute;top:0;bottom:0;left:-9998px;right:0;\nborder-left:9999px solid {$xbg};box-shadow:9999px 0 0 {$xbg};z-index:-1;}\n"); } } // custom widths for header, footer widget areas $hf_sb = array('_header_sb_' => '#header-widget-area', '_footer_sb_' => '#footer-widget-area', 'alt:_header_sb_' => '.widget-area-header', 'alt:_footer_sb_' => '.widget-area-footer', '_primary_' => '#primary-widget-area', '_secondary_' => '#secondary-widget-area', 'alt:_primary_' => '.widget-area-primary', 'alt:_secondary_' => '.widget-area-secondary', '_top_' => '.widget-area-top', '_bottom_' => '.widget-area-bottom'); $hf_sb_w = array('lw_' => '.is-desktop', 'mw_' => '.is-smalltablet', 'sw_' => '.is-phone'); $ie8_fixed = false; foreach ($hf_sb as $sb => $area) { // process each area with custom widget widths foreach ($hf_sb_w as $sb_w => $media) { // process each device $sb = str_replace('alt:', '', $sb); // Allow double rules $list = trim(weaverx_getopt($sb . $sb_w . 'cols_list')); if ($list == '') { continue; } $list = str_replace('%', '', $list); // kill %'s $list = str_replace(',', ' ', $list); // change ,'s to blanks $list = str_replace(' ;', ';', $list); // be sure the ; is right after the value $list = str_replace(';', '; ', $list); // be sure have space after ; $list = array_filter(explode(' ', $list), 'strlen'); // explode list, filter null strings if (empty($list)) { continue; } $m = $smart; if (weaverx_getopt(substr($area, 1) . '_no_widget_margins')) { // no margins? $m = 0; } weaverx_f_write($sout, "{$media} {$area} .widget {float:left;margin-left:0;margin-right:0}\n"); // reset previous list margins if ($media != '.is-phone' && !$ie8_fixed) { weaverx_f_write($sout, ".ie8 .is-desktop .begin-of-row,.ie8 .is-smalltablet .widget-odd{clear:none;}\n"); $ie8_fixed = true; } $clear = 'clear:both'; $i = 0; foreach ($list as $val) { // step through the list of values $i++; $w = str_replace(';', '', $val); // strip ; $at_end = $w != $val; // force end if was a ; before if ($w === '0') { // hide this widget weaverx_f_write($sout, $media . ' ' . $area . ' .widget-' . $i . "{display:none;}\n"); } else { if ($w) { if ($at_end) { // at end of row weaverx_f_write($sout, sprintf("{$media} %s .widget-%d{width:%.5f%%;}\n", $area, $i, $w, $clear)); $clear = 'clear:both;'; } else { weaverx_f_write($sout, sprintf("{$media} %s .widget-%d{width:%.5f%%;margin-right:%.5f%%;%s}\n", $area, $i, $w - $m, $m, $clear)); $clear = ''; } } } } } } // adjust mini-menu top margin based on hide title/tagline. Goes here so user can override with mini-menu bg css+ /* $hide_title = weaverx_getopt( 'hide_site_title' ); $hide_tag = weaverx_getopt( 'hide_site_tagline' ); if ( $hide_tag == 'hide' || $hide_title == 'hide' || strpos( $hide_tag, 'l-hide') !== false || strpos( $hide_title, 'l-hide') !== false) { weaverx_f_write( $sout, '#nav-header-mini{margin-top:34px;}' ); } */ // ================================ COLORS =================================== // Colors need to go last because they might have CSS + $titles = array('site_title' => '.wrapper #site-title a,.site-title a', 'tagline' => '#site-tagline,.site-tagline', 'page_title' => '.page-title', 'post_title' => '.wrapper .post-title', 'archive_title' => '.archive-title', 'widget_title' => '.widget-title', 'm_header_mini' => '#nav-header-mini', 'content_h' => '.entry-content h1,.entry-content h2,.entry-content h3,.entry-content h4,.entry-content h5,.entry-content h6'); foreach ($titles as $title => $rule) { weaverx_put_bgcolor($sout, $title . '_bgcolor', $rule); // bar under some titles if ($val = (int) weaverx_getopt($title . '_underline_int')) { $titleColor = weaverx_getopt($title . '_color'); if ($titleColor == '' || $titleColor == 'inherit') { $titleColor = weaverx_getopt('content_color'); } // content_color, etc, colors are generated by $area . '_color' if ($titleColor == '' || $titleColor == 'inherit') { $titleColor = weaverx_getopt('container_color'); } if ($titleColor == '' || $titleColor == 'inherit') { $titleColor = weaverx_getopt('wrapper_color'); } if ($titleColor == '' || $titleColor == 'inherit') { $titleColor = '#222'; } /* if they want a border, this is the fallback color */ weaverx_f_write($sout, sprintf($rule . "{border-bottom: {$val}px solid {$titleColor};}\n")); } if ($title == 'content_h') { // these aren't handled by adding a style weaverx_put_rule_if_checked($sout, $title . '_normal', $rule . '{font-weight:normal !important;}'); // not bold? $val = weaverx_getopt($title . '_italic'); if ($val == 'on') { weaverx_f_write($sout, "{$rule}{font-style:italic;}\n"); } else { if ($val == 'off') { weaverx_f_write($sout, "{$rule}{font-style:normal;}\n"); } } } if ($title == 'post_title' || $title == 'm_header_mini') { // stupid special cases because want the bg to work right ... $rule = $rule . ' a,' . $rule . ' a:visited'; } weaverx_put_color($sout, $title . '_color', $rule); } weaverx_put_color($sout, 'post_title_hover_color', '.wrapper .post-title a:hover'); weaverx_put_color($sout, 'm_header_mini_hover_color', '#nav-header-mini a:hover'); $val = weaverx_getopt('m_header_mini_top_margin_dec'); if ($val != '') { weaverx_f_write($sout, sprintf("#nav-header-mini{margin-top:%.5fem}\n", $val)); } weaverx_put_bgcolor($sout, 'stickypost_bgcolor', '.blog .sticky'); weaverx_put_bgcolor($sout, 'post_author_bgcolor', '#author-info'); weaverx_put_bgcolor($sout, 'hr_color', 'hr'); weaverx_put_bgcolor($sout, 'post_info_top_bgcolor', '.entry-meta'); weaverx_put_color($sout, 'post_info_top_color', '.entry-meta'); weaverx_put_bgcolor($sout, 'post_info_bottom_bgcolor', '.entry-utility'); weaverx_put_color($sout, 'post_info_bottom_color', '.entry-utility'); weaverx_put_bgcolor($sout, 'input_bgcolor', 'input,textarea'); weaverx_put_color($sout, 'input_color', 'input,textarea'); weaverx_put_bgcolor($sout, 'search_bgcolor', '.search-field,#header-search .search-field:focus'); weaverx_put_color($sout, 'search_color', '.search-field,#header-search .search-field:focus'); // =============================== TITLES ================================== // injection area bg colors $htmls = array('preheader', 'header', 'prewrapper', 'container_top', 'precontent', 'postpostcontent', 'precomments', 'pagecontentbottom', 'postcomments', 'prefooter', 'postfooter', 'presidebar', 'fixedtop', 'fixedbottom', 'postheader'); foreach ($htmls as $val) { // includes areas from Weaver Xtreme Plus, too. $prefix = $val == 'postpostcontent' ? '.' : '#'; weaverx_put_bgcolor($sout, 'inject_' . $val . '_bgcolor', $prefix . 'inject_' . $val); } if ($val = weaverx_getopt('post_title_bottom_margin_dec')) { weaverx_f_write($sout, ".post-title{margin-bottom:{$val}em;}\n"); } if ($themew != 940) { weaverx_f_write($sout, "#inject_fixedtop,#inject_fixedbottom{max-width:{$themew}px;}\n"); weaverx_f_write($sout, ".ie8 #inject_fixedtop,.ie8 #inject_fixedbottom{max-width:{$themew}px;}\n"); } // ================================ END RULES =================================== // These rules need to be at the end if (weaverx_getopt('reset_content_opts')) { weaverx_f_write($sout, ".has-posts #content {border:none; -moz-box-shadow: none; -webkit-box-shadow:none; box-shadow: none;background:transparent;padding:0;margin-top:0;margin-bottom:0;}\n"); } // ================================ PRO AREAS =================================== do_action('weaverxplus_css', $sout); if (is_customize_preview()) { // wrap these guys in ids so can more easily manipulate the DOM // always generate the <style> block so will be there to manipulate weaverx_f_write($sout, "\n</style>\n"); weaverx_f_write($sout, "\n<style id='wvrx-css-plus' type='text/css'> /* CSS+ Rules */\n"); weaverx_f_write($sout, $wvrx_css_plus); weaverx_f_write($sout, "\n</style>\n"); $add_css = weaverx_getopt('add_css'); weaverx_f_write($sout, "\n<style id='wvrx-global-css' type='text/css'> /* Global CSS Rules */\n"); weaverx_f_write($sout, apply_filters('weaverx_css', $add_css)); //weaverx_f_write($sout, "\n</style>\n"); } else { // standard site - only output CSS if really there if ($wvrx_css_plus != '') { weaverx_f_write($sout, "\n/* CSS+ Rules */\n"); weaverx_f_write($sout, $wvrx_css_plus); } $add_css = weaverx_getopt('add_css'); if (!empty($add_css)) { weaverx_f_write($sout, "\n/* Global Custom CSS Rules */\n"); weaverx_f_write($sout, apply_filters('weaverx_css', $add_css)); } } weaverx_f_write($sout, "\n/* End Weaver Xtreme CSS */\n"); }
function weaverx_saverestore() { /* admin tab for saving and restoring theme */ $weaverx_theme_dir = esc_url(weaverx_f_uploads_base_dir() . 'weaverx-theme/'); $download_path = esc_url(weaverx_relative_url('includes/download.php')); $download_img_path = esc_url(weaverx_relative_url('assets/images/download.png')); $nonce = wp_create_nonce('weaverx_download'); $a_pro = function_exists('weaverxplus_plugin_installed') ? '-plus' : ''; ?> <h3 class="atw-option-subheader" style="color:blue;"> <?php _e('Save/Restore Current Theme Settings using Your Computer', 'weaver-xtreme'); ?> </h3> <p> <?php _e('This option allows you to save and restore all current theme settings by uploading and downloading to your own computer.', 'weaver-xtreme'); ?> </p> <h3><?php _e('Download Current Settings To Your Computer', 'weaver-xtreme'); ?> </h3> <a href="<?php echo $download_path . '?_wpnonce=' . $nonce; ?> "><img src="<?php echo esc_url($download_img_path); ?> " /> <strong><?php _e('Download', 'weaver-xtreme'); ?> </strong> </a> - <?php _e('<strong>Save all</strong> current settings to file on your computer. (Full settings backup, including those marked with ♦.) <em>File:</em>', 'weaver-xtreme'); ?> <strong>weaverx-backup-settings<?php echo $a_pro; ?> .wxb</strong> <br /> <br /> <a href="<?php echo $download_path . '?_wpnoncet=' . $nonce; ?> "><img src="<?php echo esc_url($download_img_path); ?> " /> <strong><?php _e('Download', 'weaver-xtreme'); ?> </strong></a> - <?php _e('<strong><em>Save only theme related</em></strong> current settings to file on your computer. <em>File:</em> <strong>weaverx-theme-settings<?php echo $a_pro;?>.wxt</strong>', 'weaver-xtreme'); if (function_exists('weaverxplus_plugin_installed')) { echo '<p>' . __('Note: Downloaded settings include <em>Weaver Xtreme Plus</em> settings. Setting files from Weaver Xtreme Plus can be uploaded to the Free Weaver Xtreme version, but will not be used or saved by the free version.', 'weaver-xtreme') . '</p>'; } ?> <form enctype="multipart/form-data" action="<?php echo $_SERVER["REQUEST_URI"]; ?> " method="POST"> <table> <tr><td><h3><?php _e('Upload settings from file saved on your computer', 'weaver-xtreme'); ?> </h3></td></tr> <tr valign="top"> <td><?php _e('Select theme/backup file to upload:', 'weaver-xtreme'); ?> <span style="border:1px solid black;padding:2px;"><input name="uploaded" type="file" /></span> <input type="hidden" name="uploadit" value="yes" /> <?php _e('(Restores settings in file to current settings.)', 'weaver-xtreme'); ?> </td> </tr> <tr><td><span class='submit'> <input name="uploadtheme" type="submit" value="<?php _e('Upload theme/backup', 'weaver-xtreme'); ?> " /></span> <small><?php _e('<strong>Upload and Restore</strong> a theme/backup from file on your computer. Will become current settings.', 'weaver-xtreme'); ?> </small></td></tr> <tr><td> <?php if (!function_exists('weaverxplus_plugin_installed')) { echo '<small>' . __('Note: Any Weaver Xtreme Plus settings will <em>not</em> be restored for Weaver Xtreme Free version.', 'weaver-xtreme') . '</small>'; } ?> </td></tr> </table> <?php weaverx_nonce_field('uploadtheme'); ?> </form> <?php }