function weaverii_enqueue_scripts() { // action definition // need to know the page template for some conditional script inclusion global $weaverii_cur_template; $weaverii_cur_template = is_page() ? get_page_template() : 'nonpage'; $vers = weaverii_getopt('wii_style_version'); if (!$vers) { $vers = '1'; } else { $vers = sprintf("%d", $vers); } if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } // emit Weaver js vars - must be here, before scripts // generate JS values for Weaver JS Lib echo '<script type="text/javascript">'; echo 'var weaverIsMobile=' . (weaverii_use_mobile('mobile') ? 'true;' : 'false;'); echo 'var weaverIsSimMobile=' . (weaverii_sim_mobile() && weaverii_in_mobile_view() && !weaverii_use_mobile('tablet') ? 'true;' : 'false;'); echo 'var weaverIsStacked=' . (strpos(weaverii_getopt('_wii_mode_mobile'), 'nostack') === false ? 'true;' : 'false;'); $tw = weaverii_getopt('wii_theme_width_int'); if (!$tw) { $tw = 940; } echo 'var weaverThemeWidth=' . $tw . ';'; $threshold = weaverii_getopt('wii_mobile_slide_threshold'); $threshold = $threshold != '' ? $threshold : '640'; echo 'var weaverMenuThreshold=' . $threshold . ';'; echo 'var weaverHideMenuBar=' . (weaverii_getopt('wii_hide_menu_bar') ? 'true;' : 'false;'); echo 'var weaverMobileDisabled=' . (weaverii_getopt('_wii_mobile_disable') ? 'true;' : 'false;'); echo 'var weaverFlowToBottom=' . (weaverii_getopt_checked('wvr_flow_to_bottom') ? 'true;' : 'false;'); echo 'var weaverHideTooltip=' . (weaverii_getopt('wii_hide_tooltip') ? 'true;' : 'false;'); echo 'var weaverUseSuperfish=' . (weaverii_getopt('wii_use_superfish') ? 'true;' : 'false;'); echo "</script>\n"; //-- Weaver js lib - requires jQuery... wp_enqueue_script('weaverJSLib', get_template_directory_uri() . '/js/weaverjslib' . WEAVER_MINIFY . '.js', array('jquery'), WEAVERII_VERSION, true); // dynamic settings for menu fixer $default_selector = 'li:has(ul) > a'; $default_selector_leaf = 'li li li:not(:has(ul)) > a'; $params = array('selector' => apply_filters('weaver_menu_selector', $default_selector), 'selector_leaf' => apply_filters('weaver_menu_selector_leaf', $default_selector_leaf)); wp_localize_script('weaverJSLib', 'weaver_menu_params', $params); //-- HTML Page template prettify if (is_page_template('paget-html.php')) { wp_enqueue_script('weaverPrettify', get_template_directory_uri() . '/js/theme/prettify' . WEAVER_MINIFY . '.js', array(), WEAVERII_VERSION, true); } // only for html page // include scripts from pro if (function_exists('weaverii_pro_enqueue_scripts')) { weaverii_pro_enqueue_scripts($vers); } }
</h2> <ul> <?php wp_list_categories(array('orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10)); ?> </ul> </div> <?php if (weaverii_use_mobile('mobile')) { echo '<div class="wvr-clear-block"> </div>'; } /* translators: %1$s: smilie */ $archive_content = '<p>' . sprintf(__('Try looking in the monthly archives. %1$s', 'weaver-ii'), convert_smilies(':)')) . '</p>'; the_widget('WP_Widget_Archives', array('count' => 0, 'dropdown' => 1), array('after_title' => '</h2>' . $archive_content)); if (weaverii_use_mobile('mobile')) { echo '<div class="wvr-clear-block"> </div>'; } ?> <?php the_widget('WP_Widget_Tag_Cloud'); ?> </div><!-- .entry-content --> <?php } // don't show not found message ?> </article><!-- #post-0 --> </div><!-- #content -->
function weaverii_excerpt_mobile() { if (weaverii_use_mobile('mobile')) { return !weaverii_getopt_checked('wii_mobile_full_posts'); } else { return false; } }
* @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ ?> <?php /* The footer widget area is triggered if any of the areas * have widgets. So let's check that first. * * If none of the sidebars have widgets, then let's bail early. */ if (!is_active_sidebar('first-footer-widget-area') && !is_active_sidebar('second-footer-widget-area') && !is_active_sidebar('third-footer-widget-area') && !is_active_sidebar('fourth-footer-widget-area')) { return; } // check for stacked modes if (weaverii_use_mobile('mobile') && weaverii_getopt('_wii_mode_mobile') != 'weaver-mobile-smart-stacked' && !weaverii_getopt_checked('wii_mobile_show_footerwidgets')) { return; } // If we get this far, we have widgets. Let do this. ?> <div id="sidebar_wrap_footer" <?php weaverii_footer_sidebar_class(); ?> > <?php weaverii_trace_sidebar(__FILE__); if (is_rtl()) { ?> <?php if (is_active_sidebar('fourth-footer-widget-area')) { ?>
get_template_part('infobar'); } weaverii_inject_area('precontent'); ?> <div id="container" class="cf index-posts"> <?php weaverii_get_sidebar_top('index'); ?> <div id="content" class = "cf" role="main"> <?php if (have_posts()) { $paged = weaverii_get_page(); weaverii_content_nav('nav-above'); $col = 0; $num_cols = weaverii_use_mobile('mobile') ? 1 : weaverii_getopt('wii_blog_cols'); if (!$num_cols || $num_cols > 3) { $num_cols = 1; } $sticky_one = weaverii_getopt_checked('wii_blog_sticky_one') && $paged <= 1; $first_one = weaverii_getopt_checked('wii_blog_first_one') && $paged <= 1; $masonry_wrap = false; // need this for one-column posts /* Start the Loop */ weaverii_post_count_clear(); while (have_posts()) { the_post(); weaverii_post_count_bump(); if (is_sticky() && $sticky_one) { get_template_part('content', get_post_format()); } else {
$add_div = false; if ($add_enddiv) { echo '<br class="mad-br" />'; } wp_loginout(); $add_enddiv = true; } if ($add_enddiv) { echo '</div>'; } ?> </nav></div><!-- #access --></div> <!-- #wrap-bottom-menu --> <?php } else { /* ttw - move menu */ if ($show_menu && has_nav_menu($secondary_name) && (!weaverii_use_mobile('phone') || weaverii_use_mobile('phone') && !weaverii_getopt('wii_mobile_hide_secondary_menu'))) { echo '<div id="wrap-bottom-menu">' . "\n"; weaverii_mobile_menu_bar('mobile-bottom-nav', 'nav-bottom-menu', 'no-home'); ?> <div id="nav-bottom-menu"<?php echo $nav_class; ?> ><nav id="access2" class="menu_bar" role="navigation"> <?php if (weaverii_use_sf()) { wp_nav_menu(array('theme_location' => $secondary_name, 'fallback_cb' => '', 'menu_class' => 'sf-menu', 'container_class' => 'menu')); } else { wp_nav_menu(array('theme_location' => $secondary_name, 'fallback_cb' => '', 'container_class' => 'menu')); } ?> </nav></div><!-- #access2 --></div> <!-- #wrap-bottom-menu -->
function weaverii_mobile_style() { global $weaverii_mobile; if (!$weaverii_mobile) { return; } // not mobile if (!weaverii_use_mobile('any')) { // must be in full screen mode ?> <style type="text/css" media="screen"> <?php $themew = weaverii_getopt('wii_theme_width_int'); if (!$themew) { $themew = 940; } // just must have this value! echo sprintf("#wrapper{width:%dpx;}\n", $themew); // let mobile browser see full site ?> </style> <?php return; } ?> <!-- mobile options --> <style type="text/css" media="screen"> <?php switch (weaverii_get_mobile_browser()) { // for simulator case 'WeaverMobile': case 'WeaverMobileFlat': echo "#wrapper {width:320px !important;border:1px dotted #888;}\n"; // generic QVGA resolution if (weaverii_getopt_checked('wii_top_menu_before_wrapper')) { echo "#nav-top-menu, .mobile_menu_bar{margin:auto;max-width:304px !important;}\n"; } break; case 'WeaverMobileSmallTablet': echo "#wrapper {width:600px !important;border:1px dotted #888;}\n"; // small tablet if (weaverii_getopt_checked('wii_top_menu_before_wrapper')) { echo "#nav-top-menu, .mobile_menu_bar{margin:auto;max-width:600px !important;}\n"; } break; case 'WeaverMobileTablet': echo "#wrapper {width:768px !important;border:1px dotted #888;}\n"; // iPad1, iPad2 if (weaverii_getopt_checked('wii_top_menu_before_wrapper')) { echo "#nav-top-menu, .mobile_menu_bar{margin:auto;max-width:768px !important;}\n"; } break; default: break; } /* text_color = 0.213 * this.rgb[0] + 0.715 * this.rgb[1] + 0.072 * this.rgb[2] < 0.5 ? '#FFF' : '#000'; */ if (!weaverii_getopt_checked('wii_use_superfish')) { $arrows = weaverii_getopt('wii_superfish_arrows'); if ($arrows) { /* user provided an alternative */ $url = weaverii_relative_url('js/superfish/images/arrows-' . $arrows . '.png'); echo ".sf-sub-indicator {background: url({$url}) no-repeat -10px -100px;}\n"; } } if ($opt = weaverii_getopt('_wii_mobile_css')) { echo $opt; } if ($weaverii_mobile['type'] == 'tablet') { if (!weaverii_getopt_checked('wii_mobile_keep_site_margins')) { echo "body {padding:0px !important;}\n"; } } ?> </style> <?php }
function weaveriip_header_gadget_code($which = 0) { /* This is called from header.php, and will insert code into the #branding div of the header. */ global $weaverii_cur_page_ID; if (!weaverii_pro_isset('hdr_num_opts')) { weaveriip_header_init(); } // echo("<!-- Weaver II Pro Header Gadgets - Page ID: $weaverii_cur_page_ID; -->\n"); $lim = weaverii_pro_getopt('hdr_num_opts'); if ($which < 1) { // coming from header, not shortcode $max = weaverii_pro_getopt('hdr_use_for_header'); if ($max != '' && $max < $lim) { $lim = $max; } } for ($i = 1; $i <= $lim; $i++) { if ($which > 0 && $which != $i) { continue; } $x = 0; $y = 0; $img = ''; $imgalt = ''; $text = ''; $textstyle = ''; $link = ''; $linkalt = ''; $base = 'hdr_' . $i . '_'; if (weaverii_pro_getopt($base . 'hidemobile') && weaverii_use_mobile('mobile')) { continue; } if (weaverii_pro_getopt($base . 'hidetablet') && weaverii_use_mobile('tablet')) { continue; } if (weaverii_pro_isset($base . 'page')) { $page = weaverii_pro_getopt($base . 'page'); if ($page != '' && $page != $weaverii_cur_page_ID) { continue; } // show only on one page, but not this one. if (weaverii_is_checked_page_opt('wvr_plus_hidecustomheader')) { // maybe skip if (!($page != '' && $page == $weaveriip_cur_page_ID)) { continue; } } } if (weaverii_pro_isset($base . 'x')) { $x = weaverii_pro_getopt($base . 'x'); } $xunits = weaverii_pro_isset($base . '_xunits') ? weaverii_pro_getopt($base . '_xunits') : 'px'; if ($xunits == '') { $xunits = 'px'; } if (weaverii_pro_isset($base . 'y')) { $y = weaverii_pro_getopt($base . 'y'); } $yunits = weaverii_pro_isset($base . '_yunits') ? weaverii_pro_getopt($base . '_yunits') : 'px'; if ($yunits == '') { $yunits = 'px'; } if (weaverii_pro_isset($base . 'img')) { $img = weaverii_pro_getopt($base . 'img'); } if (weaverii_pro_isset($base . 'imgalt')) { $imgalt = weaverii_pro_getopt($base . 'imgalt'); } if (weaverii_pro_isset($base . 'text')) { $text = do_shortcode(weaverii_pro_getopt($base . 'text')); } if (weaverii_pro_isset($base . 'textstyle')) { $textstyle = weaverii_pro_getopt($base . 'textstyle'); } if (weaverii_pro_isset($base . 'link')) { $link = weaverii_pro_getopt($base . 'link'); } if (weaverii_pro_isset($base . 'linkalt')) { $linkalt = weaverii_pro_getopt($base . 'linkalt'); } if (weaverii_pro_isset($base . 'newpage')) { $newpage = weaverii_pro_getopt($base . 'newpage'); } if ($img == '' && $text == '' && $textstyle == '') { continue; } echo '<span id="wvr_gadget_' . $i . '" class="wvr_gadget" style="position:absolute;z-index:4;left:' . $x . $xunits . ';top:' . $y . $yunits . ';' . $textstyle . '">'; if ($link != '') { $target = $newpage ? ' target="_blank"' : ''; echo '<a href="' . $link . '" title="' . $linkalt . '"' . $target . ' style="color:inherit;">'; } if ($img != '') { echo '<img class="wvr_gadget_img" src="' . $img . '" title="' . $imgalt . '" alt="' . $imgalt . '" />'; } if ($text != '') { echo $text; } if ($link != '') { echo "</a>"; } echo "</span>\n"; } ?> <?php }
function weaverii_pro_opt_cache($switch = null) { // load the options cache - from regular or mobile depending... global $weaverii_pro_opts; if (isset($switch)) { $weaverii_pro_opts = $switch; } else { if (!$weaverii_pro_opts) { $weaverii_pro_opts = apply_filters('weaverii_switch_theme_pro', get_option(apply_filters('weaver_options', 'weaverii_pro'), array())); } } if (weaverii_getopt_checked('_wii_mobile_alt_theme') && !is_admin() && weaverii_use_mobile('mobile')) { $weaverii_pro_opts = get_option(apply_filters('weaver_options', 'weaverii_pro_mobile')); if ($weaverii_pro_opts === false) { $weaverii_pro_opts = get_option(apply_filters('weaver_options', 'weaverii_pro')); } } }
function weaverii_sc_vimeo($args = '') { $share = ''; if (isset($args[0])) { $share = trim($args[0]); } extract(shortcode_atts(array('id' => '', 'sd' => false, 'color' => '', 'autoplay' => false, 'loop' => false, 'portrait' => true, 'title' => true, 'byline' => true, 'w' => 0, 'h' => 0, 'ratio' => false, 'percent' => 100, 'center' => '1'), $args)); if (!$share && !$id) { return '<strong>No share or id values provided for weaver_vimeo shortcode.</strong>'; } if ($w == 0) { $w = $sd ? 640 : 1280; } if ($h == 0) { $h = $sd ? 480 : 720; } if ($ratio) { $h = $w * $ratio; } $GLOBALS['wvr_videos_count'] = true; if ($share) { // let the share override any id $share = str_replace('http://vimeo.com/', '', $share); if ($share) { $id = $share; } } $opts = $id . '##'; $opts = weaverii_add_url_opt($opts, $autoplay, 'autoplay=1'); $opts = weaverii_add_url_opt($opts, $loop, 'loop=1'); $opts = weaverii_add_url_opt($opts, $color, 'color=' . $color); $opts = weaverii_add_url_opt($opts, !$portrait, 'portrait=0'); $opts = weaverii_add_url_opt($opts, !$title, 'title=0'); $opts = weaverii_add_url_opt($opts, !$byline, 'byline=0'); $url = 'http://player.vimeo.com/video/'; $opts = str_replace('##+', '##?', $opts); $opts = str_replace('##', '', $opts); $opts = str_replace('+', '&', $opts); $url .= $opts; if (weaverii_use_mobile('mobile')) { $percent = 100; } // $vert = $sd ? 0.75 : 0.5625; // if ($ratio) $vert = $ratio; $cntr1 = $center ? '<div class="wvr-fitvids" style="margin:0 auto;max-width:' . $percent . '%;">' : '<div class="wvr-fitvids" style="max-width:' . $percent . '%;">'; $cntr2 = '</div>'; return "\n" . $cntr1 . '<iframe src="' . $url . '" width="' . $w . '" height="' . $h . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>' . $cntr2 . "\n"; }
?> " title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?> " rel="home"> <?php } global $weaverii_header; /* Check if this is a post or page, if it has a thumbnail, and if it's a big one */ if (is_singular() && !(weaverii_use_mobile('mobile') && weaverii_getopt('wii_hide_mobile_fi')) && !weaverii_getopt('wii_hide_featured_header') && has_post_thumbnail($post->ID) && ($image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full')) && $image[1] >= $weaverii_header['width']) { echo get_the_post_thumbnail($post->ID, 'full'); } else { if (weaverii_use_mobile('mobile') && weaverii_getopt('_wii_mobile_header_url')) { echo '<img src="' . esc_attr(apply_filters('weaverii_css', weaverii_getopt('_wii_mobile_header_url'))) . '" alt="' . esc_attr(get_bloginfo('name', 'display')) . '" />' . "\n"; } else { if (weaverii_use_mobile('tablet') && weaverii_getopt('_wii_mobile_tablet_header_url')) { echo '<img src="' . esc_attr(apply_filters('weaverii_css', weaverii_getopt('_wii_mobile_tablet_header_url'))) . '" alt="' . esc_attr(get_bloginfo('name', 'display')) . '" />' . "\n"; } else { if (($alt_img = weaverii_getopt('wii_alt_header_img')) != '') { if (strstr($alt_img, '<img') === FALSE) { echo '<img src="' . apply_filters('weaverii_css', esc_attr($alt_img)) . '" alt="' . esc_attr(get_bloginfo('name', 'display')) . '" />' . "\n"; } else { echo esc_attr($alt_img); } } else { $hdr = get_header_image(); if ($hdr) { ?> <img src="<?php echo $hdr; ?>
function wvrx_ts_sc_vimeo($args = '') { $share = ''; if (isset($args[0])) { $share = trim($args[0]); } extract(shortcode_atts(array('id' => '', 'sd' => false, 'color' => '', 'autoplay' => false, 'loop' => false, 'portrait' => true, 'title' => true, 'byline' => true, 'percent' => 100, 'center' => '1'), $args)); if (!$share && !$id) { return __('<strong>No share or id values provided for vimeo shortcode.</strong>', 'weaverx-theme-support'); } if ($share) { // let the share override any id $share = str_replace('http://vimeo.com/', '', $share); if ($share) { $id = $share; } } $opts = $id . '##'; $opts = wvrx_ts_add_url_opt($opts, $autoplay, 'autoplay=1'); $opts = wvrx_ts_add_url_opt($opts, $loop, 'loop=1'); $opts = wvrx_ts_add_url_opt($opts, $color, 'color=' . $color); $opts = wvrx_ts_add_url_opt($opts, !$portrait, 'portrait=0'); $opts = wvrx_ts_add_url_opt($opts, !$title, 'title=0'); $opts = wvrx_ts_add_url_opt($opts, !$byline, 'byline=0'); $url = '//player.vimeo.com/video/'; $opts = str_replace('##+', '##?', $opts); $opts = str_replace('##', '', $opts); $opts = str_replace('+', '&', $opts); $url .= $opts; if (function_exists('weaverii_use_mobile')) { if (weaverii_use_mobile('mobile')) { $percent = 100; } } $cntr1 = $center ? "<div class=\"wvrx-video wvrx-vimeo\" style=\"margin-left:auto;margin-right:auto;max-width:{$percent}%;\">" : "<div class=\"wvrx-video wvrx-vimeo\" style=\"max-width:{$percent}%;\">"; $cntr2 = '</div>'; $h = 9; $w = 16; if ($sd) { $h = 3; $w = 4; } $ret = "\n" . $cntr1 . '<iframe src="' . $url . '" width="' . $w . '" height="' . $h . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>' . $cntr2 . "\n"; return $ret; }
// Exit if accessed directly /** * The template for displaying the footer. * * Contains all content after the closing of the id=main div * * @package WordPress * @subpackage Weaver II * @since Weaver II 1.0 */ weaverii_trace_template(__FILE__); if (weaverii_getopt_checked('wii_footer_last')) { // move footer outside of page, allows wide footer echo "</div><!-- #wrapper -->\n"; } if (weaverii_use_mobile('mobile') && weaverii_getopt('_wii_mode_mobile') != 'weaver-mobile-smart-stacked' || weaverii_getopt('_wii_mode_mobile') == 'weaver-mobile-resp-nostack') { weaverii_put_widgetarea('mobile-widget-area', 'mobile_widget_area'); } weaverii_inject_area('prefooter'); // put the prefooter optional area if (!weaverii_getopt('wii_hide_footer') && !weaverii_is_checked_page_opt('ttw-hide-footer')) { ?> <footer id="colophon" role="contentinfo"> <div> <?php if (weaverii_getopt_checked('wii_footer_inject_move')) { weaverii_inject_area('footer'); // here is where the footer options get inserted get_sidebar('footer'); // get the sidebar-footer temeplate } else {