function weaverx_mce_css($default_style) { /* replace the default editor-style.css with custom CSS generated on the fly by the php version */ if (weaverx_getopt('_hide_editor_style')) { return $default_style; } $mce_css_file = trailingslashit(get_template_directory()) . 'editor-style-css.php'; $mce_css_dir = trailingslashit(get_template_directory_uri()) . 'editor-style-css.php'; if (!@file_exists($mce_css_file)) { // see if it is there return $default_style; } /* do we need to do anything about rtl? */ /* if we have a custom style file, return that instead of the default */ // Build the overrides $put = '?mce=1'; // cheap way to start with ? if ($twidth = weaverx_getopt_default('theme_width_int', 940)) { /* figure out a good width - we will please most of the users, most of the time We're going to assume that mostly people will use the default layout - we can't actually tell if the editor will be for a page or a post at this point. And let's just assume the default sidebar widths. */ $sb_layout = weaverx_getopt_default('layout_default', 'right'); switch ($sb_layout) { case 'left': case 'left-top': $sb_width = weaverx_getopt_default('left_sb_width_int', 25); break; case 'split': case 'split-top': $sb_width = weaverx_getopt_default('left_split_sb_width_int', 25) + weaverx_getopt_default('right_split_sb_width_int', 25); break; case 'one-column': $sb_width = 0; break; default: // right $sb_width = weaverx_getopt_default('right_sb_width_int', 25); break; } $content_w = $twidth - $twidth * (double) ($sb_width / 95.0); // .95 by trial and error // calculate theme width based on default layout and width of sidebars. $put .= '&twidth=' . urlencode($content_w); } //if (($val = weaverx_getopt('site_fontsize_int'))) // base font size // $put .= '&fontsize=' . urlencode($val); if (($base_font_px = weaverx_getopt('site_fontsize_int')) == '') { $base_font_px = 16; } $base_font_px = (double) $base_font_px; $font_size = 'default'; if (!is_page() && ($area_font = weaverx_getopt_default('post_font_size', 'default')) != 'default') { $font_size = $area_font; } else { if (($area_font = weaverx_getopt_default('content_font_size', 'default')) != 'default') { $font_size = $area_font; } else { if (($area_font = weaverx_getopt_default('container_font_size', 'default')) != 'default') { $font_size = $area_font; } else { if (($area_font = weaverx_getopt_default('wrapper_font_size', 'default')) != 'default') { $font_size = $area_font; } } } } switch ($font_size) { // find conversion factor case 'xxs-font-size': $h_fontmult = 0.625; break; case 'xs-font-size': $h_fontmult = 0.75; break; case 's-font-size': $h_fontmult = 0.875; break; case 'l-font-size': $h_fontmult = 1.125; break; case 'xl-font-size': $h_fontmult = 1.25; break; case 'xxl-font-size': $h_fontmult = 1.5; break; default: $h_fontmult = 1; break; } $em_font_size = $base_font_px / 16.0 * $h_fontmult; $put .= '&fontsize=' . $em_font_size; $val = weaverx_getopt_default('content_font_family', 'default'); if ($val == 'default') { $val = weaverx_getopt_default('container_font_family', 'default'); } if ($val == 'default') { $val = weaverx_getopt('wrapper_font_family'); } if ($val != 'default') { // found a font { // these are not translatable - the values are used to define the actual font definition $fonts = array('sans-serif' => 'Arial,sans-serif', 'arialBlack' => '"Arial Black",sans-serif', 'arialNarrow' => '"Arial Narrow",sans-serif', 'lucidaSans' => '"Lucida Sans",sans-serif', 'trebuchetMS' => '"Trebuchet MS", "Lucida Grande",sans-serif', 'verdana' => 'Verdana, Geneva,sans-serif', 'alegreya-sans' => "'Alegreya Sans', sans-serif", 'roboto' => "'Roboto', sans-serif", 'roboto-condensed' => "'Roboto Condensed', sans-serif", 'source-sans-pro' => "'Source Sans Pro', sans-serif", 'serif' => 'TimesNewRoman, "Times New Roman",serif', 'cambria' => 'Cambria,serif', 'garamond' => 'Garamond,serif', 'georgia' => 'Georgia,serif', 'lucidaBright' => '"Lucida Bright",serif', 'palatino' => '"Palatino Linotype",Palatino,serif', 'alegreya' => "'Alegreya', serif", 'roboto-slab' => "'Roboto Slab', serif", 'source-serif-pro' => "'Source Serif Pro', serif", 'monospace' => '"Courier New",Courier,monospace', 'consolas' => 'Consolas,monospace', 'inconsolata' => "'Inconsolata', monospace", 'roboto-mono' => "'Roboto Mono', sans-serif", 'papyrus' => 'Papyrus,cursive,serif', 'comicSans' => '"Comic Sans MS",cursive,serif', 'handlee' => "'Handlee', cursive", 'open-sans' => "'Open Sans', sans-serif", 'open-sans-condensed' => "'Open Sans Condensed', sans-serif", 'droid-sans' => "'Droid Sans', sans-serif", 'droid-serif' => "'Droid Serif', serif", 'exo-2' => "'Exo 2', sans-serif", 'lato' => "'Lato', sans-serif", 'lora' => "'Lora', serif", 'arvo' => "'Arvo', serif", 'archivo-black' => "'Archivo Black', sans-serif", 'vollkorn' => "'Vollkorn', serif", 'ultra' => "'Ultra', serif", 'arimo' => "'Arimo', serif", 'tinos' => "'Tinos', serif"); if (isset($fonts[$val])) { $font = $fonts[$val]; } else { $font = "Arial,'Helvetica Neue',Helvetica,sans-serif"; // fallback // scan Google Fonts $gfonts = weaverx_getopt_array('fonts_added'); if (!empty($gfonts)) { foreach ($gfonts as $gfont) { $slug = sanitize_title($gfont['name']); if ($slug == $val) { $font = str_replace('font-family:', '', $gfont['family']); //'Papyrus'; break; } } } } $put .= '&fontfamily=' . urlencode($font); } /* need to handle bg color of content area - need to do the cascade yourself */ if (($val = weaverx_getopt('editor_bgcolor')) && strcasecmp($val, 'transparent') != 0) { /* alt bg color */ $put .= '&bg=' . urlencode($val); } else { if (($val = weaverx_getopt('content_bgcolor')) && strcasecmp($val, 'transparent') != 0) { /* #content */ $put .= '&bg=' . urlencode($val); } else { if (($val = weaverx_getopt('container_bgcolor')) && strcasecmp($val, 'transparent') != 0) { /* #container */ $put .= '&bg=' . urlencode($val); } else { if (($val = weaverx_getopt('wrapper_bgcolor')) && strcasecmp($val, 'transparent') != 0) { /* #wrapper */ $put .= '&bg=' . urlencode($val); } else { if (($name = weaverx_getopt('themename')) && strcasecmp($name, 'Transparent Dark') === 0) { $put .= '&bg=' . urlencode('#222'); } else { if (($name = weaverx_getopt('themename')) && strcasecmp($name, 'Transparent Light') === 0) { $put .= '&bg=' . urlencode('#ccc'); } } } } } } if ($val = weaverx_getopt('content_color')) { // text color $put .= '&textcolor=' . urlencode($val); } elseif ($val = weaverx_getopt('container_color')) { // text color $put .= '&textcolor=' . urlencode($val); } elseif ($val = weaverx_getopt('wrapper_color')) { // text color $put .= '&textcolor=' . urlencode($val); } if ($val = weaverx_getopt('input_bgcolor')) { // input area $put .= '&inbg=' . urlencode($val); } if ($val = weaverx_getopt('input_color')) { $put .= '&incolor=' . urlencode($val); } if ($val = weaverx_getopt('contentlink_color')) { // link $put .= '&a=' . urlencode($val); } if ($val = weaverx_getopt('contentlink_hover_color')) { $put .= '&ahover=' . urlencode($val); } if ($val = weaverx_getopt('weaverx_tables')) { // table type $put .= '&table=' . urlencode($val); } if ($val = weaverx_getopt('contentlist_bullet')) { // list bullet $put .= '&list=' . urlencode($val); } // images if ($val = weaverx_getopt('caption_color')) { // image caption, border color, width $put .= '&imgcapt=' . urlencode($val); } if ($val = weaverx_getopt('media_lib_border_color')) { $put .= '&imgbcolor=' . urlencode($val); } if ($val = weaverx_getopt('media_lib_border_int')) { $put .= '&imgbwide=' . urlencode($val); } return $default_style . ',' . $mce_css_dir . $put; }
function weaverx_render_infinite_scroll() { $GLOBALS['weaverx_page_who'] = 'blog'; $num_cols = weaverx_getopt('blog_cols'); if (!$num_cols || $num_cols > 3) { $num_cols = 1; } $col = 0; $masonry_wrap = false; // need this for one-column posts /* Start the Loop */ weaverx_post_count_clear(); echo "<div class=\"wvrx-posts\">\n"; while (have_posts()) { the_post(); weaverx_post_count_bump(); if (!$masonry_wrap) { $masonry_wrap = true; if (weaverx_masonry('begin-posts')) { // wrap all posts $num_cols = 1; } // force to 1 cols } weaverx_masonry('begin-post'); // wrap each post switch ($num_cols) { case 1: get_template_part('templates/content', get_post_format()); $sticky_one = false; break; case 2: $col++; echo '<div class="content-2-col clearfix">' . "\n"; get_template_part('templates/content', get_post_format()); echo "</div> <!-- content-2-col -->\n"; $sticky_one = false; break; case 3: $col++; echo '<div class="content-3-col clearfix">' . "\n"; get_template_part('templates/content', get_post_format()); echo "</div> <!-- content-3-col -->\n"; $sticky_one = false; break; default: get_template_part('templates/content', get_post_format()); $sticky_one = false; } // end switch num cols weaverx_masonry('end-post'); } // end while have posts weaverx_masonry('end-posts'); echo "</div>\n"; }
function weaverx_mainopts_widgets() { $opts = array(array('type' => 'submit'), array('name' => __('Sidebar Options', 'weaver-xtreme'), 'id' => '-screenoptions', 'type' => 'header', 'info' => __('Settings affecting main Sidebars and individual widgets', 'weaver-xtreme'), 'help' => 'help.html#WidgetAreas'), array('name' => __('Individual Widgets', 'weaver-xtreme'), 'id' => 'widget', 'type' => 'widget_area', 'info' => __('Properties for individual widgets (e.g., Text, Recent Posts, etc.)', 'weaver-xtreme')), array('name' => __('Widget Title', 'weaver-xtreme'), 'id' => 'widget_title', 'type' => 'titles', 'info' => __('Color for Widget Titles.', 'weaver-xtreme')), array('name' => __('Bar under Widget Titles', 'weaver-xtreme'), 'id' => 'widget_title_underline_int', 'type' => 'val_px', 'info' => __('Enter size in px if you want a bar under Widget Titles. Leave blank or 0 for no bar.', 'weaver-xtreme')), array('name' => __('Widget List Bullet', 'weaver-xtreme'), 'id' => 'widgetlist_bullet', 'type' => 'select_id', 'info' => __('Bullet used for Unordered Lists in Widget areas.', 'weaver-xtreme'), 'value' => array(array('val' => 'disc', 'desc' => __('Filled Disc (default)', 'weaver-xtreme')), array('val' => 'circle', 'desc' => __('Circle', 'weaver-xtreme')), array('val' => 'square', 'desc' => __('Square', 'weaver-xtreme')), array('val' => 'none', 'desc' => __('None', 'weaver-xtreme')))), array('name' => __('Widget Links', 'weaver-xtreme'), 'id' => 'wlink', 'type' => 'link', 'info' => __('Color for links in widgets (uses Standard Link colors if left blank).', 'weaver-xtreme')), array('type' => 'submit'), array('name' => __('Primary Widget Area', 'weaver-xtreme'), 'id' => 'primary', 'type' => 'widget_area_submit', 'info' => __('Properties for the Primary (Upper/Left) Sidebar Widget Area.', 'weaver-xtreme')), array('name' => __('Secondary Widget Area', 'weaver-xtreme'), 'id' => 'secondary', 'type' => 'widget_area_submit', 'info' => __('Properties for the Secondary (Lower/Right) Sidebar Widget Area.', 'weaver-xtreme')), array('name' => __('Top Widget Areas', 'weaver-xtreme'), 'id' => 'top', 'type' => 'widget_area_submit', 'info' => __('Properties for all Top Widget areas (Sitewide, Pages, Blog, Archive).', 'weaver-xtreme')), array('name' => __('Bottom Widget Areas', 'weaver-xtreme'), 'id' => 'bottom', 'type' => 'widget_area', 'info' => __('Properties for all Bottom Widget areas (Sitewide, Pages, Blog, Archive).', 'weaver-xtreme'))); weaverx_form_show_options($opts); ?> <hr /> <span style="color:blue;"><b>Define Per Page Extra Widget Areas</b></span> <?php weaverx_help_link('help.html#PPWidgets', 'Help for Per Page Widget Areas'); ?> <br/> <small> <?php _e('You may define extra widget areas that can then be used in the <em>Per Page</em> settings, or in the <em>Weaver Xtreme Plus</em> [widget_area] shortcode. Enter a list of one or more widget area names separated by commas. Your names should include only letters, numbers, or underscores - no spaces or other special characters. The widgets areas will then appear on the Appearance->Widgets menus. They can be included on individual pages by adding the name you define here to the "Weaver Xtreme Options For This Page" box on the Edit Page screen. (♦)', 'weaver-xtreme'); ?> </small> <br /> <?php weaverx_textarea(weaverx_getopt('_perpagewidgets'), '_perpagewidgets', 1, ' ', $style = 'width:60%;', $class = 'wvrx-edit'); do_action('weaverxplus_admin', 'widget_areas'); }
function weaverx_2_add_fonts($fonts) { // this code adds all the new Google Fonts to the Legacy plugin Font picker. $base = array(array('val' => 'inherit', 'desc' => __('Inherit', 'weaver-xtreme')), array('val' => 'open-sans', 'desc' => __('Open Sans', 'weaver-xtreme')), array('val' => 'open-sans-condensed', 'desc' => __('Open Sans Condensed', 'weaver-xtreme')), array('val' => 'alegreya-sans', 'desc' => __('Alegreya Sans', 'weaver-xtreme')), array('val' => 'archivo-black', 'desc' => __('Archivo Black', 'weaver-xtreme')), array('val' => 'arimo', 'desc' => __('Arimo', 'weaver-xtreme')), array('val' => 'droid-sans', 'desc' => __('Droid Sans', 'weaver-xtreme')), array('val' => 'exo-2', 'desc' => __('Exo 2', 'weaver-xtreme')), array('val' => 'lato', 'desc' => __('Lato', 'weaver-xtreme')), array('val' => 'roboto', 'desc' => __('Roboto', 'weaver-xtreme')), array('val' => 'roboto-condensed', 'desc' => __('Roboto Condensed', 'weaver-xtreme')), array('val' => 'source-sans-pro', 'desc' => __('Source Sans Pro', 'weaver-xtreme')), array('val' => 'alegreya', 'desc' => __('Alegreya (Serif)', 'weaver-xtreme')), array('val' => 'arvo', 'desc' => __('Arvo Slab', 'weaver-xtreme')), array('val' => 'droid-serif', 'desc' => __('Droid Serif', 'weaver-xtreme')), array('val' => 'lora', 'desc' => __('Lora', 'weaver-xtreme')), array('val' => 'roboto-slab', 'desc' => __('Roboto Slab', 'weaver-xtreme')), array('val' => 'source-serif-pro', 'desc' => __('Source Serif Pro', 'weaver-xtreme')), array('val' => 'tinos', 'desc' => __('Tinos', 'weaver-xtreme')), array('val' => 'vollkorn', 'desc' => __('Vollkorn', 'weaver-xtreme')), array('val' => 'ultra', 'desc' => __('Ultra Black', 'weaver-xtreme')), array('val' => 'inconsolata', 'desc' => __('Inconsolata (Mono)', 'weaver-xtreme')), array('val' => 'roboto-mono', 'desc' => __('Roboto Mono', 'weaver-xtreme')), array('val' => 'handlee', 'desc' => __('Handlee (Cursive)', 'weaver-xtreme'))); if (!weaverx_getopt('disable_google_fonts')) { if (!empty($fonts)) { unset($fonts[0]); } // kill original 'default' return array_merge($base, $fonts); // put the new fonts at the top } else { return $fonts; } }
function weaverx_custom_css($value = '') { $css = weaverx_getopt('add_css'); if (isset($value['id'])) { $icon = $value['id']; } if (!isset($icon) || !$icon) { $icon = ' '; } $dash = ''; if ($icon[0] == '-') { // add a leading icon $dash = '<span style="padding:.2em;" class="dashicons dashicons-' . substr($icon, 1) . '"></span>'; } ?> <tr class="atw-row-header"><td colspan="3"> <a id="custom-css-rules"></a> <span style="color:black;padding:.2em;" class="dashicons dashicons-screenoptions"></span> <span style="font-weight:bold; font-size: larger;"><em> <?php _e('Custom CSS Rules', 'weaver-xtreme'); ?> <?php weaverx_help_link('help.html#CustomCSS', __('Custom CSS Rules', 'weaver-xtreme')); ?> </em></span> </td></tr> <tr><td colspan="3"> <!-- ======== --> <p> <?php _e('Rules you add here will be the <em>last</em> CSS Rules included by Weaver Xtreme, and thus override all other Weaver Xtreme generated CSS rules. Specify complete CSS rules, but don\'t add the <style> HTML element. You can prefix your selectors with <code>.is-desktop, .is-mobile, .is-smalltablet, or .is-phone</code> to create rules for specific devices. <strong>NOTE:</strong> Because Weaver Xtreme uses classes on many of its elements, you may to need to use <em>!important</em> with your rules to force the style override. It is possible that other plugins might generate CSS that comes after these rules.', 'weaver-xtreme'); ?> </p> <?php weaverx_textarea(weaverx_getopt('add_css'), 'add_css', 12, '', 'width:95%;', 'wvrx-edit wvrx-edit-dir'); ?> </td></tr> <?php }
/** * Adds the classes to the widget in the front-end */ function weaverx_add_widget_classes($params) { global $wp_registered_widgets; $arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets $sb_id = $params[0]['id']; // Get the id for the current sidebar we're processing $widget_id = $params[0]['widget_id']; // add first, last, even, and odd, and widget classes $area_map = array('primary-widget-area' => 'primary', 'secondary-widget-area' => 'secondary', 'footer-widget-area' => 'footer', 'sitewide-top-widget-area' => 'top', 'page-top-widget-area' => 'top', 'postpages-widget-area' => 'top', 'blog-top-widget-area' => 'top', 'sitewide-bottom-widget-area' => 'bottom', 'page-bottom-widget-area' => 'bottom', 'blog-bottom-widget-area' => 'bottom', 'header-widget-area' => 'header_sb', 'footer-widget-area' => 'footer_sb', 'primary' => 'primary', 'secondary' => 'secondary', 'widget' => 'widget', 'header' => 'header_sb', 'footer' => 'footer_sb', 'top' => 'top', 'bottom' => 'bottom'); $opt_name = 'widget'; // default styling option name: widget-xxx $search_sb_id = $sb_id; if (weaverx_t_get('use_widget_area')) { // map from replacement area or [extra_widget_area] $search_sb_id = weaverx_t_get('use_widget_area'); } foreach ($area_map as $area => $opt) { // need to find name to use for option values if ($search_sb_id == $area) { $opt_name = $opt; break; } } $cols = weaverx_getopt_default($opt_name . '_cols_int', 1); if ($cols > 8) { $cols = 8; } // sanity check $show_number = true; $show_evenodd = true; if (!isset($arr_registered_widgets[$sb_id]) || !is_array($arr_registered_widgets[$sb_id])) { return $params; } if (empty($GLOBALS['wvr_widget_number']) || !isset($GLOBALS['wvr_widget_number']) || !$GLOBALS['wvr_widget_number']) { // global to keep track of which widget this is $GLOBALS['wvr_widget_number'] = array(); } if (isset($GLOBALS['wvr_widget_number'][$sb_id])) { // initialize or bump widget number $GLOBALS['wvr_widget_number'][$sb_id]++; } else { $GLOBALS['wvr_widget_number'][$sb_id] = 1; } $is_sidebar = in_array($sb_id, array('primary-widget-area', 'secondary-widget-area')); // this is a vertical widget $no_smart = weaverx_getopt($opt_name . '_no_widget_margins'); $is_vert = $cols == 1; $per_row_tail = $is_vert || $no_smart ? ' ' : '-m '; $class = ''; $sides = $is_sidebar ? '-b' : '-rb'; $cur_widget = $GLOBALS['wvr_widget_number'][$sb_id]; $widget_count = count($arr_registered_widgets[$sb_id]); $first = $cur_widget == 1; $last = $cur_widget == $widget_count; $def_bottom = 'margin-bottom'; if ($opt_name == 'header_sb') { $def_bottom = 'no-margin-vertical '; } $area_class = weaverx_area_class('widget', 'not-pad', $sides, $def_bottom) . ' '; if ($area_class) { $class .= $area_class; } if (!$is_vert) { $class .= 'per-row-' . $cols . $per_row_tail; $end_of_row = $cur_widget % $cols == 0; if ($widget_count > 1 && !$end_of_row && !$no_smart) { $class .= 'smart-rm '; } if ($end_of_row) { $class .= 'end-of-row '; } if ($cur_widget % $cols == 1) { $class .= 'begin-of-row '; } } $class .= 'widget-' . $GLOBALS['wvr_widget_number'][$sb_id] . ' '; if ($is_vert) { $widget_first = 'widget-first widget-first-vert '; $widget_last = 'widget-last widget-last-vert '; } else { $widget_first = 'widget-first '; $widget_last = 'widget-last '; } if ($first) { $class .= $widget_first; } if ($last) { $class .= $widget_last; } if ($show_evenodd) { $widget_even = 'widget-even '; $widget_odd = 'widget-odd '; $class .= $cur_widget % 2 ? $widget_odd : $widget_even; } // need no-margin-bottom if $cols > 1 $params[0]['before_widget'] = str_replace('">', ' ' . trim($class) . '">', $params[0]['before_widget']); $title_class = weaverx_title_class('widget_title', true); if ($title_class) { $params[0]['before_title'] = str_replace('">', ' ' . trim($title_class) . '">', $params[0]['before_title']); } return $params; }
// allow anyone to override bradcrumbs via action do_action('weaverx_paginate'); } else { if ($pwp || !is_singular()) { if (function_exists('wp_pagenavi')) { wp_pagenavi(); } elseif (function_exists('wp_paginate')) { wp_paginate('title='); } else { echo weaverx_get_paginate_archive_page_links('plain', 2, 2); } } } echo "</span>\n"; } if (weaverx_getopt('info_search')) { if (function_exists('weaverxplus_search_form')) { echo '<span id="infobar_search" style="padding-right:4px !important;display:inline-block;padding-left:20px;">'; echo weaverxplus_search_form('', 120); echo '</span>'; } else { echo '<span id="infobar_search">'; get_search_form(); echo '</span>'; } } if (weaverx_getopt_checked('info_addlogin')) { echo '<span id="infobar_login">'; wp_loginout(); echo '</span>'; }
function weaverx_cz_choices_font_family() { $base = array('inherit' => __('Inherit', 'weaver-xtreme')); $google = array('google' => __('---* Google Fonts (For All Browsers) *', 'weaver-xtreme'), 'sans-g' => __('--- -- Sans-Serif Google Fonts --', 'weaver-xtreme'), 'open-sans' => __('Open Sans', 'weaver-xtreme'), 'open-sans-condensed' => __('Open Sans Condensed', 'weaver-xtreme'), 'alegreya-sans' => __('Alegreya Sans', 'weaver-xtreme'), 'archivo-black' => __('Archivo Black', 'weaver-xtreme'), 'arimo' => __('Arimo', 'weaver-xtreme'), 'droid-sans' => __('Droid Sans', 'weaver-xtreme'), 'exo-2' => __('Exo 2', 'weaver-xtreme'), 'lato' => __('Lato', 'weaver-xtreme'), 'roboto' => __('Roboto', 'weaver-xtreme'), 'roboto-condensed' => __('Roboto Condensed', 'weaver-xtreme'), 'source-sans-pro' => __('Source Sans Pro', 'weaver-xtreme'), 'serif-g' => __('--- -- Serif Google Fonts --', 'weaver-xtreme'), 'alegreya' => __('Alegreya', 'weaver-xtreme'), 'arvo' => __('Arvo Slab', 'weaver-xtreme'), 'droid-serif' => __('Droid Serif', 'weaver-xtreme'), 'lora' => __('Lora', 'weaver-xtreme'), 'roboto-slab' => __('Roboto Slab', 'weaver-xtreme'), 'source-serif-pro' => __('Source Serif Pro', 'weaver-xtreme'), 'tinos' => __('Tinos', 'weaver-xtreme'), 'vollkorn' => __('Vollkorn', 'weaver-xtreme'), 'ultra' => __('Ultra Black', 'weaver-xtreme'), 'mono-g' => __('--- -- Monospace Google Fonts --', 'weaver-xtreme'), 'inconsolata' => __('Inconsolata', 'weaver-xtreme'), 'roboto-mono' => __('Roboto Mono', 'weaver-xtreme'), 'cursive-g' => __('--- -- "Cursive" Google Fonts --', 'weaver-xtreme'), 'handlee' => __('Handlee', 'weaver-xtreme'), 'blank-w' => __('--- ', 'weaver-xtreme')); $web = array('web' => __('---* Web Fonts *', 'weaver-xtreme'), 'web-hote' => __('--- - May not match on Android/iOS -', 'weaver-xtreme'), 'sans-w' => __('--- -- Sans-Serif Web Fonts --', 'weaver-xtreme'), 'sans-serif' => __('Arial', 'weaver-xtreme'), 'arialBlack' => __('Arial Black', 'weaver-xtreme'), 'arialNarrow' => __('Arial Narrow', 'weaver-xtreme'), 'lucidaSans' => __('Lucida Sans', 'weaver-xtreme'), 'trebuchetMS' => __('Trebuchet MS', 'weaver-xtreme'), 'verdana' => __('Verdana', 'weaver-xtreme'), 'serif-w' => __('--- -- Serif Web Fonts --', 'weaver-xtreme'), 'serif' => __('Times', 'weaver-xtreme'), 'cambria' => __('Cambria', 'weaver-xtreme'), 'garamond' => __('Garamond', 'weaver-xtreme'), 'georgia' => __('Georgia', 'weaver-xtreme'), 'lucidaBright' => __('Lucida Bright', 'weaver-xtreme'), 'palatino' => __('Palatino', 'weaver-xtreme'), 'mono-w' => __('--- -- Monospace Web Fonts --', 'weaver-xtreme'), 'monospace' => __('Courier', 'weaver-xtreme'), 'consolas' => __('Consolas', 'weaver-xtreme'), 'cursive-w' => __('--- -- "Cursive" Web Fonts --', 'weaver-xtreme'), 'papyrus' => __('Papyrus', 'weaver-xtreme'), 'comicSans' => __('Comic Sans MS', 'weaver-xtreme')); $gfonts = weaverx_getopt_array('fonts_added'); if (!empty($gfonts)) { foreach ($gfonts as $gfont => $val) { // $gfont has slug, $val has vals $base[$gfont] = $val['name'] . ' (' . WEAVERX_PLUS_ICON . 'font)'; } } if (!weaverx_getopt('disable_google_fonts')) { $base = array_merge($base, $google); } $base = array_merge($base, $web); return $base; }
if (!defined('ABSPATH')) { exit; } // Exit if accessed directly /** * The template used for displaying page content in page.php * * @package WordPress * @subpackage Weaver X * @since Weaver Xtreme 1.0 */ weaverx_fi('page', 'post-before'); $pclass = 'content-page'; $cols = weaverx_get_per_page_value('_pp_page_cols'); if ($cols == '') { $cols = weaverx_getopt('page_cols'); } if ($cols != '' && $cols != '1') { $pclass .= " cols-{$cols}"; } ?> <article id="post-<?php the_ID(); ?> " <?php post_class($pclass); ?> > <div class="entry-content clearfix"> <?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' 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'); }
/** * Start the element output. */ public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { $indent = $depth ? str_repeat("\t", $depth) : ''; $classes = empty($item->classes) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; /** * Filter the CSS class(es) applied to a menu item's list item element. */ $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth)); $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; $megamenu = strpos($class_names, 'mega-menu') !== false && function_exists('weaverxplus_plugin_installed'); if ($megamenu) { $class_names = str_replace('mega-menu', '', $class_names); } // have to move it down /** * Filter the ID applied to a menu item's list item element. */ $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth); $id = $id ? ' id="' . esc_attr($id) . '"' : ''; $output .= $indent . '<li' . $id . $class_names . '>'; $atts = array(); $atts['title'] = !empty($item->attr_title) ? $item->attr_title : ''; $atts['target'] = !empty($item->target) ? $item->target : ''; $atts['rel'] = !empty($item->xfn) ? $item->xfn : ''; $atts['href'] = !empty($item->url) ? $item->url : ''; /** * Filter the HTML attributes applied to a menu item's anchor element. */ $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth); $attributes = ''; $aclass = ''; foreach ($atts as $attr => $value) { if (!empty($value)) { $value = 'href' === $attr ? esc_url($value) : esc_attr($value); if ($attr === 'href' && $value === '#' && weaverx_getopt('placeholder_cursor')) { $aclass = ' style="cursor:' . weaverx_getopt('placeholder_cursor') . ';"'; } $attributes .= ' ' . $attr . '="' . $value . '"'; } } $item_output = $args->before; $item_output .= "<a{$attributes}{$aclass}>"; /** This filter is documented in wp-includes/post-template.php */ $item_output .= $args->link_before . do_shortcode(apply_filters('the_title', $item->title, $item->ID)) . $args->link_after; $item_output .= "</a>"; $item_output .= $args->after; if ($megamenu) { $desc = !empty($item->description) ? $item->description : __('Please enter MegaMenu content to Description.', 'weaver-xtreme'); $item_output .= '<ul class="mega-menu"><li>' . do_shortcode($desc) . '</li></ul>'; } /** * Filter a menu item's starting output. */ $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); }
function weaverx_put_css_plus($sout, $id, $tag) { if ($style = weaverx_getopt($id . '_css')) { global $wvrx_css_plus; $prefix = ''; $suffix = ''; if (is_customize_preview()) { // Generate a rule that can be easily modified in the DOM $prefix = "/*-=:{$id}_css:=-*/"; $suffix = "/*-:{$id}_css:-*/"; } if (strpos($style, '%selector') !== false) { // user is using $selectors $tags = explode(',', $tag); foreach ($tags as $selector) { $replaced = str_replace('%selector%', trim($selector), $style); $wvrx_css_plus .= apply_filters('weaverx_css', sprintf("%s%s %s%s\n", $prefix, $selector, $replaced, $suffix)); //weaverx_f_write( $sout, apply_filters( 'weaverx_css', sprintf( "%s%s %s%s\n", $selector, $replaced ) ) ); } } else { $wvrx_css_plus .= apply_filters('weaverx_css', sprintf("%s%s %s%s\n", $prefix, $tag, $style, $suffix)); // weaverx_f_write( $sout, apply_filters( 'weaverx_css', sprintf( "%s %s\n", $tag, $style ) ) ); } } }
</div> <?php } ?> </nav><!-- #nav-above --> <?php get_template_part('templates/content', 'single'); ?> <nav id="nav-below" class="navigation"> <h3 class="assistive-text"><?php echo __('Post navigation', 'weaver-xtreme'); ?> </h3> <?php if (weaverx_getopt('single_nav_style') == 'prev_next') { ?> <div class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav">←</span> Previous', 'weaver-xtreme'), $cats); ?> </div> <div class="nav-next"><?php next_post_link('%link', __('Next <span class="meta-nav">→</span>', 'weaver-xtreme'), $cats); ?> </div> <?php } else { ?> <div class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">' . _x('←', 'Previous post link', 'weaver-xtreme') . '</span> %title', weaverx_getopt_checked('single_nav_link_cats')); ?>
public static function reset_options($contents) { if (substr($contents, 0, 10) == 'WXT-V01.00') { $type = 'theme'; } else { if (substr($contents, 0, 10) == 'WXB-V01.00') { $type = 'backup'; } else { $val = substr($contents, 0, 10); self::$wvrx_error = __("Wrong theme file format version", 'weaver-xtreme') . ':' . $val; return false; /* simple check for one of ours */ } } $restore = array(); $restore = unserialize(substr($contents, 10)); if (!$restore) { self::$wvrx_error = __("Unserialize failed", 'weaver-xtreme'); return false; } $version = weaverx_getopt('weaverx_version_id'); // get something to force load $new_cache = array(); global $weaverx_opts_cache; if ($type == 'theme') { // need to clear some settings // first, pickup the per-site settings that aren't theme related... foreach ($weaverx_opts_cache as $key => $val) { if (isset($key[0]) && $key[0] == '_') { // these are non-theme specific settings $new_cache[$key] = $val; } // keep } $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { if (isset($key[0]) && $key[0] != '_') { $new_cache[$key] = $val; } // and add rest from restore } } else { if ($type == 'backup') { $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { $new_cache[$key] = $val; // overwrite with saved values } } } $new_cache['weaverx_version_id'] = $version; $new_cache['wvrx_css_saved'] = ''; $new_cache['last_option'] = 'Weaver Xtreme'; $new_cache['style_date'] = date('Y-m-d-H:i:s'); delete_option('weaverx_settings'); update_option('weaverx_settings', $new_cache); $save_dir = weaverx_f_uploads_base_dir() . 'weaverx-subthemes'; $usename = 'style-weaverxt.css'; $filename = $save_dir . '/' . $usename; @unlink($filename); $weaverx_opts_cache = $new_cache; if (weaverx_f_file_access_available()) { // and now is the time to update the style file require_once get_template_directory() . '/includes/generatecss.php'; weaverx_fwrite_current_css(); } return true; }
function weaverx_ex_set_current_to_serialized_values($contents) { global $weaverx_opts_cache; // need to mess with the cache if (substr($contents, 0, 10) == 'WXT-V01.00') { $type = 'theme'; } else { if (substr($contents, 0, 10) == 'WXB-V01.00') { $type = 'backup'; } else { $val = substr($contents, 0, 10); return weaverx_f_fail(__("Wrong theme file format version", 'weaver-xtreme') . ':' . $val); /* simple check for one of ours */ } } $restore = array(); $restore = unserialize(substr($contents, 10)); if (!$restore) { return weaverx_f_fail(__("Unserialize failed", 'weaver-xtreme')); } $version = weaverx_getopt('weaverx_version_id'); // get something to force load if ($type == 'theme') { // need to clear some settings // first, pickup the per-site settings that aren't theme related... $new_cache = array(); foreach ($weaverx_opts_cache as $key => $val) { if (isset($key[0]) && $key[0] == '_') { // these are non-theme specific settings $new_cache[$key] = $val; } // keep } $opts = $restore['weaverx_base']; // fetch base opts weaverx_delete_all_options(); foreach ($opts as $key => $val) { if (isset($key[0]) && $key[0] != '_') { weaverx_setopt($key, $val, false); } // overwrite with saved theme values } foreach ($new_cache as $key => $val) { // set the values we need to keep weaverx_setopt($key, $val, false); } } else { if ($type == 'backup') { weaverx_delete_all_options(); $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { weaverx_setopt($key, $val, false); // overwrite with saved values } } } weaverx_setopt('weaverx_version_id', $version); // keep version, force save of db weaverx_setopt('wvrx_css_saved', ''); weaverx_setopt('last_option', 'Weaver Xtreme'); weaverx_save_opts('loading theme'); // OK, now we've saved the options, update them in the DB return true; }
case 'xl-font-size': $h_fontmult = 1.25; break; case 'xxl-font-size': $h_fontmult = 1.5; break; default: $h_fontmult = 1; break; } if (isset($GLOBALS['weaverx_sb_layout'])) { $sb_layout = $GLOBALS['weaverx_sb_layout']; } else { $sb_layout = 'none'; } $local = array('hideTip' => weaverx_getopt('hide_tooltip') ? '1' : '0', 'hFontFamily' => $content_h_ff, 'hFontMult' => $h_fontmult, 'sbLayout' => $sb_layout, 'flowColor' => weaverx_getopt('flow_color') ? '1' : '0', 'full_browser_height' => weaverx_getopt('full_browser_height') || weaverx_is_checked_page_opt('_pp_full_browser_height') ? '1' : '0', 'primary' => weaverx_getopt('primary_eq_widgets') ? '1' : '0', 'secondary' => weaverx_getopt('secondary_eq_widgets') ? '1' : '0', 'top' => weaverx_getopt('top_eq_widgets') ? '1' : '0', 'bottom' => weaverx_getopt('bottom_eq_widgets') ? '1' : '0', 'header_sb' => weaverx_getopt('header_sb_eq_widgets') ? '1' : '0', 'footer_sb' => weaverx_getopt('footer_sb_eq_widgets') ? '1' : '0'); wp_localize_script('weaverxJSLibEnd', 'wvrxEndOpts', $local); // in footer.php because don't know the values yet in functions.php wp_footer(); weaverx_masonry('invoke-code'); if (WEAVERX_DEV_MODE) { $end_time = microtime(true); weaverx_debug_comment('Page generated in: ' . round($end_time - $GLOBALS['wvrx_timer'], 3) . ' seconds.'); } ?> <script> function bigImg(x) { x.style.height = "219px"; x.style.width = "300px"; }
function weaverx_generate_wphead() { /* this guy does ALL the work for generating theme look - it writes out the over-rides to the standard style.css */ global $weaverx_main_options, $weaverx_cur_page_ID; global $post; $weaverx_cur_page_ID = 0; // need this for 404 page when this is not valid if (is_object($post)) { $weaverx_cur_page_ID = get_the_ID(); } // we're on a page now, so set the post id for the rest of the session printf("\n<!-- This site is using %s %s (%s) subtheme: %s -->\n", WEAVERX_THEMENAME, WEAVERX_VERSION, weaverx_getopt('style_version'), weaverx_getopt('themename')); do_action('weaverxplus_show_version'); if (weaverx_use_inline_css(weaverx_get_css_filename())) { // generate inline CSS echo '<style type="text/css">' . "\n"; if (isset($_REQUEST['wp_customize'])) { // don't use cached CSS from customizer $css = ''; } else { $css = weaverx_getopt_default('wvrx_css_saved', ''); } if ($css == '' || $css[0] != '/') { // there isn't an entry in the DB, so do it on the fly require_once get_template_directory() . '/includes/generatecss.php'; // include only now at runtime. $output = weaverx_f_open('php://output', 'w+'); weaverx_output_style($output); } else { weaverx_echo_css($css); } echo "\n</style> <!-- end of main options style section -->\n"; } else { // include generated file $vers = weaverx_getopt('style_version'); if (!$vers) { $vers = '1'; } else { $vers = sprintf("%d", $vers); } wp_enqueue_style('weaverxp-style-sheet', weaverx_get_css_url(), array('weaver-root-style-sheet'), $vers); wp_enqueue_style('weaverxp-style-sheet'); } /* now head options */ weaverx_echo_css(weaverx_getopt('_althead_opts')); weaverx_echo_css(weaverx_getopt('head_opts')); /* let the user have the last word! */ $per_page_code = weaverx_get_per_page_value('page-head-code'); if (!empty($per_page_code)) { weaverx_echo_css($per_page_code); } if (weaverx_is_checked_page_opt('_pp_hide_site_title')) { /* best to just do this inline */ echo '<style type="text/css">#site-title,#site-tagline{display:none;}#nav-header-mini{margin-top:32px!important;}</style>' . "\n"; } if ($ppsb = weaverx_get_per_page_value('_pp_sidebar_width') > 0) { require_once get_template_directory() . '/includes/generatecss.php'; // include only now at runtime. $ppsb = weaverx_get_per_page_value('_pp_sidebar_width'); echo "<style type=\"text/css\"> /* Per Page Sidebar Width */\n"; weaverx_sidebar_style('echo', $ppsb); echo "</style>\n"; } echo "\n<!-- End of Weaver Xtreme options -->\n"; }
// Loop over posts and relocate stickies to the front. for ($i = 0; $i < $num_posts; $i++) { if (in_array($wp_query->posts[$i]->ID, $sticky_posts)) { $sticky_post = $wp_query->posts[$i]; // Remove sticky from current position array_splice($wp_query->posts, $i, 1); // Move to front, after other stickies array_splice($wp_query->posts, $sticky_offset, 0, array($sticky_post)); // Increment the sticky offset. The next sticky will be placed at this offset. $sticky_offset++; } } } } /* Start the Loop */ $num_cols = weaverx_getopt('blog_cols'); // default $pp = weaverx_get_per_page_value('_pp_wvrx_pwp_cols'); if ($pp) { $num_cols = $pp; } if (!$num_cols || $num_cols > 3) { $num_cols = 1; } $sticky_one = weaverx_getopt_checked('blog_sticky_one') && $paged <= 1; $first_one = weaverx_getopt_checked('blog_first_one') && $paged <= 1; $masonry_wrap = false; // need this for one-column posts $col = 0; $hide_n_posts = weaverx_get_per_page_value('_pp_hide_n_posts'); if ($hide_n_posts == '' || $hide_n_posts < 1 || $hide_n_posts > 100) {
if ($use_smart) { // ================== SMART MENUS $hamburger = weaverx_getopt('m_secondary_hamburger'); if ($hamburger == '') { $hamburger = '<span class="genericon genericon-menu"></span>'; } $left = '<span href="" class="wvrx-menu-button">' . "{$hamburger}</span>{$left}"; } $menu_class = apply_filters('weaverx_menu_class', 'weaverx-theme-menu wvrx-menu menu-hover', 'secondary'); $align = weaverx_getopt('m_secondary_align'); if ($align == 'center') { $menu_class .= ' wvrx-center-menu'; } else { if ($align == 'right') { $menu_class .= ' menu-alignright'; } else { $menu_class .= ' menu-alignleft'; } } if (weaverx_getopt('m_secondary_move')) { echo "\n\n<div id=\"nav-secondary\" class=\"menu-secondary menu-secondary-moved menu-type-standard\">\n"; } else { echo "\n\n<div id=\"nav-secondary\" class=\"menu-secondary menu-secondary-standard menu-type-standard\">\n"; } wp_nav_menu(array('fallback_cb' => '', 'theme_location' => $menu, 'menu_class' => $menu_class, 'container' => 'div', 'container_class' => 'wvrx-menu-container ' . $class, 'items_wrap' => $left . $right . '<div class="wvrx-menu-clear"></div><ul id="%1$s" class="%2$s">%3$s</ul><div style="clear:both;"></div>', 'walker' => new weaverx_Walker_Nav_Menu())); echo "\n</div><div class='clear-menu-secondary-end' style='clear:both;'></div><!-- /.menu-secondary -->\n\n"; if ($use_smart) { do_action('weaverx_plus_smartmenu', 'nav-secondary', 'm_secondary'); } // emit required JS to invoke smartmenu }
wp_list_pages($args); echo "</ul></div>\n"; echo "<div id='sitemap-posts'><br /><h3>" . __('Posts', 'weaver-xtreme') . "</h3><ul class='xoxo sitemap-pages-month'>\n"; wp_get_archives(array('type' => 'monthly', 'show_post_count' => true)); echo "</ul></div>\n"; if (!weaverx_getopt('post_hide_categories')) { echo "<div id='sitemap-categories'><br /><h3>" . __('Categories', 'weaver-xtreme') . "</h3><ul class='xoxo sitemap-categories'>\n"; wp_list_categories(array('show_count' => true, 'use_desc_for_title' => true, 'title_li' => false)); echo "</ul></div>\n"; } if (!weaverx_getopt('post_hide_tags')) { echo "<div id='sitemap-tags'><br /><h3>" . __('Tag Cloud', 'weaver-xtreme') . "</h3><ul class='xoxo sitemap-tag'>\n"; wp_tag_cloud(array('number' => 0)); echo "</ul></div>\n"; } if (!weaverx_getopt('post_hide_author')) { echo "<div id='sitemap-authors'><br /><h3>" . __('Authors', 'weaver-xtreme') . "</h3><ul class='xoxo sitemap-authors'>\n"; wp_list_authors(array('exclude_admin' => false, 'optioncount' => true, 'title_li' => false)); echo "</ul></div>\n"; } echo "</div><!-- weaver-sitemap -->\n"; ?> </div><!-- .entry-content --> <footer class="entry-utility-page"> <?php weaverx_edit_link(); ?> </footer><!-- .entry-utility-page --> </article><!-- #post-<?php the_ID(); ?>
function weaverx_admin_admin() { ?> <div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-generic"></span> <?php _e('Basic Administrative Options', 'weaver-xtreme'); weaverx_help_link('help.html#AdminOptions', 'Help for Admin Options'); ?> </div> <p> <?php _e('These options control some administrative options and appearance features.', 'weaver-xtreme'); ?> </p> <br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_disable_customizer'); ?> " id="disable_customizer" <?php checked(weaverx_getopt_checked('_disable_customizer')); ?> /> <?php _e('<strong>Disable Weaver Xtreme Customizer Interface</strong> - If you have a slow host or slow computer, checking this option will disable loading the Weaver Xtreme Customizer interface. ♦', 'weaver-xtreme'); ?> </label><br /><br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_donate'); ?> " id="hide_donate" <?php checked(weaverx_getopt_checked('_hide_donate')); ?> /> <?php _e('I\'ve Donated - <small>Thank you for donating to the Weaver Xtreme theme. This will hide the Donate button. Purchasing Weaver Xtreme Plus also hides the Donate button.</small> ♦', 'weaver-xtreme'); ?> </label><br /><br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_editor_style'); ?> " id="_hide_editor_style" <?php checked(weaverx_getopt_checked('_hide_editor_style')); ?> /> <?php _e('Disable Page/Post Editor Styling - <small>Checking this box will disable the Weaver Xtreme subtheme based styling in the Page/Post editor. If you have a theme using transparent backgrounds, this option will likely improve the Post/Page editor visibility. ♦</small>', 'weaver-xtreme'); ?> </label><br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_auto_css_rules'); ?> " id="hide_auto_css_rules" <?php checked(weaverx_getopt_checked('_hide_auto_css_rules')); ?> /> <?php _e('Don\'t auto-display CSS rules - <small>Checking this box will disable the auto-display of Main Option elements that have CSS settings.</small> ♦', 'weaver-xtreme'); ?> </label><br /> <input name="<?php weaverx_sapi_main_name('_css_rows'); ?> " id="css_rows" type="text" style="width:30px;height:20px;" class="regular-text" value="<?php weaverx_esc_textarea(weaverx_getopt('_css_rows')); ?> " /> <?php _e('lines - Set CSS+ text box height - <small>You can increase the default height of the CSS+ input area (1 to 25 lines).</small> ♦', 'weaver-xtreme'); ?> <br /> <br /> <h3 class="atw-option-subheader"><?php _e('Per Page and Per Post Option Panels by Roles<', 'weaver-xtreme'); ?> /h3> <p> <?php _e('Single site Administrator and Multi-Site Super Administrator will always have the Per Page and Per Post options panel displayed. You may selectively disable these options for other User Roles using the check boxes below.', 'weaver-xtreme'); ?> </p> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_mu_admin_per'); ?> " id="_hide_mu_admin_per" <?php checked(weaverx_getopt_checked('_hide_mu_admin_per')); ?> /> <?php _e('Hide Per Page/Post Options for MultiSite Admins', 'weaver-xtreme'); ?> </label> ♦<br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_editor_per'); ?> " id="_hide_editor_per" <?php checked(weaverx_getopt_checked('_hide_editor_per')); ?> /> <?php _e('Hide Per Page/Post Options for Editors', 'weaver-xtreme'); ?> </label> ♦<br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_hide_author_per'); ?> " id="_hide_author_per" <?php checked(weaverx_getopt_checked('_hide_author_per')); ?> /> <?php _e('Hide Per Page/Post Options for Authors and Contributors', 'weaver-xtreme'); ?> </label> ♦<br /> <br /> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_show_per_post_all'); ?> " id="_hide_author_per" <?php checked(weaverx_getopt_checked('_show_per_post_all')); ?> /> <?php _e('Show Per Post Options for Custom Post Types ♦ - <small>Shows the Per Post options box on "Custom Post Type Editor" admin pages', 'weaver-xtreme'); ?> </small> </label> <br /> <br /><br /> <div class="atw-option-subheader"><?php _e('Theme Name and Description', 'weaver-xtreme'); ?> </div> <p> <?php _e('You can change the name and description of your current settings if you would like to create a new theme theme file for sharing with others, or for you own identification.', 'weaver-xtreme'); ?> </p> <?php _e('Theme Name:', 'weaver-xtreme'); ?> <input name="<?php weaverx_sapi_main_name('themename'); ?> " id="themename" value="<?php echo weaverx_getopt('themename'); ?> " /> <br /> <?php _e('Description:', 'weaver-xtreme'); ?> <?php weaverx_textarea(weaverx_getopt('theme_description'), 'theme_description', 2, __('Describe the theme', 'weaver-xtreme'), 'width:65%;'); ?> <br /> <br /> <h3 class="atw-option-subheader"><?php _e('Subtheme Notes', 'weaver-xtreme'); ?> </h3> <p> <?php _e('This box may be used to keep notes and instructions about settings made for a custom subtheme. It will be saved in the both \'.wxt\' and \'.wxb\' settings files.', 'weaver-xtreme'); ?> </p> <?php weaverx_textarea(weaverx_getopt('subtheme_notes'), 'subtheme_notes', 2, __('Notes about theme', 'weaver-xtreme'), 'width:75%;'); do_action('weaverxplus_admin', 'admin_options'); }
/** * Enqueue customizer preview script * * Hooked to 'customize_preview_init' via weaverx_customizer_init() * */ function weaverx_customizer_preview_script() { wp_enqueue_script('weaverx_cz-customizer-preview', get_template_directory_uri() . '/admin/customizer/js/customizer-preview' . WEAVERX_MINIFY . '.js', array('customize-preview'), WEAVERX_VERSION, true); $date = getdate(); $year = $date['year']; $cp = weaverx_getopt('copyright'); // so can restore default from customizer if (!$cp) { $cp = '©' . $year . ' - <a href="' . esc_url(home_url('/')) . '" title="' . esc_attr(get_bloginfo('name', 'display')) . '" rel="home">' . esc_attr(get_bloginfo('name', 'display')) . '</a>'; } $local = array('copyright' => $cp, 'more_msg' => __('Continue reading →', 'weaver-xtreme')); wp_localize_script('weaverx_cz-customizer-preview', 'wvrxPRE', $local); }
function weaverx_author_info() { if (get_the_author_meta('description') && !weaverx_getopt('hide_author_bio')) { // If a user has filled out their description, show a bio on their entries ?> <div style="clear:both;"></div> <div id="author-info"> <div id="author-description"> <div id="author-avatar"> <?php echo get_avatar(get_the_author_meta('user_email'), apply_filters('weaverx_author_bio_avatar_size', 75)); ?> </div><!-- #author-avatar --> <p class="author-title"><?php printf(esc_attr__('About %s', 'weaver-xtreme'), get_the_author()); ?> </p> <p><?php the_author_meta('description'); ?> </p> <div id="author-link"> <span class="vcard author post-author"><span class="fn"> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?> " rel="author"> <?php printf(__('View all posts by %s', 'weaver-xtreme'), get_the_author()); ?> </a></span></span> </div><!-- #author-link --> </div><!-- #author-description --> </div><!-- #author-info --> <?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'); }
} weaverx_masonry('end-posts'); weaverx_content_nav('nav-below', true); } else { ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="page-title content-title title-search"><?php echo __('Nothing Found', 'weaver-xtreme'); ?> </h1> </header><!-- .entry-header --> <?php if (!weaverx_getopt('_hide_not_found_search')) { ?> <div class="entry-content clearfix"> <p><?php echo __('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'weaver-xtreme'); ?> </p> <?php get_search_form(); ?> </div><!-- .entry-content --> <?php } ?> </article><!-- #post-0 -->
<?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly // Bottom Widget Area $l_area = 'l-sb-right'; if (weaverx_getopt('primary_smartmargin') || weaverx_getopt('secondary_smartmargin')) { $l_area .= '-lm'; } $class = $l_area . ' m-full s-full sb-float-right ' . weaverx_area_class('secondary', 'pad', '', 'margin-bottom'); echo '<div style="clear:right;"></div>'; weaverx_put_widgetarea('secondary-widget-area', $class); weaverx_clear_both('secondary-widget-area');
if ($hamburger == '') { $hamburger = '<span class="genericon genericon-menu"></span>'; } $left = '<span href="" class="wvrx-menu-button">' . "{$hamburger}</span>{$left}"; } $menu_class = apply_filters('weaverx_menu_class', 'weaverx-theme-menu wvrx-menu menu-hover', 'primary'); if ($align == 'center') { $menu_class .= ' wvrx-center-menu'; } else { if ($align == 'right') { $menu_class .= ' menu-alignright'; } else { $menu_class .= ' menu-alignleft'; } } if (weaverx_getopt('m_primary_move')) { echo "\n\n<div id=\"nav-primary\" class=\"menu-primary menu-primary-moved menu-type-standard\">\n"; } else { echo "\n\n<div id=\"nav-primary\" class=\"menu-primary menu-primary-standard menu-type-standard\">\n"; } $args = array('fallback_cb' => 'weaverx_page_menu', 'theme_location' => $menu, 'menu_class' => $menu_class, 'container' => 'div', 'container_class' => 'wvrx-menu-container ' . $class, 'items_wrap' => $left . $right . '<div class="wvrx-menu-clear"></div><ul id="%1$s" class="%2$s">%3$s</ul><div style="clear:both;"></div>'); $locations = get_nav_menu_locations(); if (isset($locations[$menu])) { $the_menu = wp_get_nav_menu_object($locations[$menu]); if (!empty($the_menu)) { $args['fallback_cb'] = ''; $args['walker'] = new weaverx_Walker_Nav_Menu(); } } wp_nav_menu($args); echo "</div><div class='clear-menu-primary-end' style='clear:both;'></div><!-- /.menu-primary -->\n\n";
echo '<div class="clear-header-image" style="clear:both"></div>'; // needs a clear if not an img } } echo "\t\t</div><!-- #header-image -->\n"; } // ! $really_hide } /* end hide-header-image */ if (weaverx_getopt('title_over_image')) { echo '</div><!--/#title-over-image -->' . "\n"; } weaverx_header_widget_area('after_header'); // show header widget area if set to this position /* ======== EXTRA HTML ======== */ $extra = weaverx_getopt('header_html_text'); $hide = weaverx_getopt_default('header_html_hide', 'hide-none'); if ($extra == '' && is_customize_preview()) { echo '<div id="header-html" style="display:inline;"></div>'; // need the area there for customizer live preview } else { if ($extra != '' && $hide != 'hide') { $c_class = weaverx_area_class('header_html', 'not-pad', '-none', 'margin-none'); ?> <div id="header-html" class="<?php echo $c_class; ?> "> <?php echo do_shortcode($extra); ?>
function weaverx_adv_site_opts() { ?> <div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-generic"></span> <?php _e('Site Options', 'weaver-xtreme'); ?> <?php weaverx_help_link('help.html#AdvSiteOptions', __('Help on Advanced Site Options', 'weaver-xtreme')); ?> </div><br /> <?php _e('These options are available to fine tune various aspects of your site. Technically, these features are not part of the theme styling, but cover other aspects of site functionality.', 'weaver-xtreme'); ?> <br /> <hr /> <!-- ======== --> <?php if (weaverx_f_file_access_available()) { ?> <h3><?php _e('Inline CSS - (Xtreme-Plus Option)', 'weaver-xtreme'); ?> </h3> <label><input type="checkbox" name="<?php weaverx_sapi_main_name('_inline_style'); ?> " id="_inline_style" <?php checked(weaverx_getopt_checked('_inline_style')); ?> /> <?php _e('Generate inline CSS code rather than using style-weaverxt.css file. By default, Weaverx Xtreme Plus will use the style-weaverxt.css file. ♦', 'weaver-xtreme'); ?> </label><br /><br /> <?php } ?> <br /> <div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-format-image"></span><span style="color:blue;font-size:larger;"> <b><?php _e('FavIcon', 'weaver-xtreme'); ?> </b></span></div></br /> <p> <?php _e('You can add a FavIcon to your site with this option. The preferred FavIcon is in the <code>.ico</code> format which has the most universal browser compatibility. However, <code>.png, .gif, and .jpg</code> will work for most modern browsers. The standard sizes are 16x16, 32x32, or 48x48 px. You can alternatively load a <code>favicon.ico</code> file to the root directory of your site. ♦', 'weaver-xtreme'); ?> </p> <p> <?php $icon = weaverx_getopt('_favicon_url'); if ($icon != '') { echo '<img src="' . esc_url($icon) . '" alt="favicon" /> '; } ?> <strong><?php _e('FavIcon URL:', 'weaver-xtreme'); ?> </strong> <?php weaverx_textarea(weaverx_getopt('_favicon_url'), '_favicon_url', 1, 'URL ', $style = 'width:350px;'); ?> <?php weaverx_media_lib_button('_favicon_url'); ?> <?php _e('Full path to FavIcon', 'weaver-xtreme'); ?> </p><br /> <div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-page"></span><span style="color:blue;font-size:larger;"> <b><?php _e('Exclude Pages from SiteMap', 'weaver-xtreme'); ?> </b></span></div></br /> <p> <?php _e('You can specify a comma separated list of Page IDs to be excluded from the SiteMap Page list. To exclude pages from Search results, use a plugin such as "Search Exclude". You can hide different sections of the SiteMap by adding rules to the "Custom CSS Rules" box. To hide authors, for example, add the rule <code>#sitemap-authors{display:none;}</code>. The IDs for the SiteMap sections are: <code>#sitemap-pages, #sitemap-posts, #sitemap-categories, #sitemap-tags, #sitemap-authors</code>', 'weaver-xtreme'); ?> </p> <p> <?php $exclude = weaverx_getopt('_sitemap_exclude_pages'); ?> <strong><?php _e('Exclude Pages from SiteMap', 'weaver-xtreme'); ?> : </strong> <?php weaverx_textarea(weaverx_getopt('_sitemap_exclude_pages'), '_sitemap_exclude_pages', 1, '1,2,3', $style = 'width:350px;'); ?> </p><br /> <div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-hammer"></span> <span style="color:blue;font-size:larger;"> <b><?php _e('SEO - Search Engine Optimization', 'weaver-xtreme'); ?> </b> </span></div><br /> <p> <?php _e('The Weaver Xtreme Theme has been designed to follow the latest SEO guidelines. Each non-home page will use the recommended "Page Title | Site Title" format, and the site is formatted using the appropriate HTML5 tags for optimal SEO performance. An SEO plugin may help you optimize your site for SEO, but is not required. See the <em>Help</em> tab for recommended SEO plugins.', 'weaver-xtreme'); ?> </p><br /> <div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-home"></span> <span style="color:blue;font-size:larger;"> <b><?php _e('Home Page', 'weaver-xtreme'); ?> </b> </span></div> <p> <?php _e('WordPress allows you to specify what page is used for your home page - either the standard WordPress blog, or a static page (which can be a Weaver Xtreme "Page with Posts" page). Please see the Weaver Xtreme Help topic for a more complete explanation.', 'weaver-xtreme'); ?> </p> <p> <?php _e('You can set the front page on the Dashboard <em>Settings→Reading panel</em>:', 'weaver-xtreme'); ?> <a href="<?php echo esc_url(home_url('/') . 'wp-admin/options-reading.php'); ?> "> <strong><?php _e('Set Front Page Displays', 'weaver-xtreme'); ?> </strong></a></p><br /> <div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-admin-users"></span> <span style="color:blue;font-size:larger;"> <b><?php _e('Author Avatars', 'weaver-xtreme'); ?> </b> </span></div> <p> <?php _e('For the best look, your site should support Avatars - a small image associated with a contributors e-mail address. Gravatar.com is probably the most popular Avatar support, and is closely associated with WordPress. You should set up a Gravatar for the main authors of your blog. For contributors without any avatar, WordPress will automatically generate an avatar. See the <strong>Settings → Discussion</strong> admin page for avatar settings.', 'weaver-xtreme'); ?> </p> <hr /> <?php do_action('weaverxplus_admin', 'site_opts'); do_action('weaverx_child_siteoptions'); }