function weaverii_generate_wphead() { /* this guy does ALL the work for generating theme look - it writes out the over-rides to the standard style.css */ global $weaverii_cur_page_ID; global $post; $weaverii_cur_page_ID = 0; // need this for 404 page when this is not valid if (is_object($post)) { $weaverii_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", WEAVERII_THEMENAME, WEAVERII_VERSION, weaverii_getopt('wii_style_version'), weaverii_getopt('wii_subtheme')); printf("<!-- Page ID: %s -->\n", $weaverii_cur_page_ID); // emit Weaver II's required dynamic JavaScript // support for Masonry script // weaverii_masonry('invoke-code'); // handle 3 stylesheet situations // default: used weaver-style.css // no weaver-style.css: when first installed, there will not be a weaver-style.css, so use inline instead // force inline: user wants inline css if (weaverii_use_inline_css(weaverii_get_css_filename())) { // generate inline CSS require_once 'generatecss.php'; // include only now at runtime. echo '<style type="text/css">' . "\n"; $output = weaverii_f_open('php://output', 'w+'); weaverii_output_style($output); echo "</style> <!-- end of main options style section -->\n"; } if (weaverii_dev_mode() && weaverii_getopt_checked('_wii_diag_borders')) { ?> <style type="text/css"> #content,#colophon,#branding,.widget,#infobar,.widget-area {border: 1px solid #F00 !important;} #wrapper,#container,#main{border: 1px solid blue;} </style> <?php } /* now head options */ echo weaverii_getopt('_wii_althead_opts'); echo weaverii_getopt('wii_head_opts'); /* let the user have the last word! */ $per_page_code = weaverii_get_per_page_value('page-head-code'); if (!empty($per_page_code)) { echo $per_page_code; } weaverii_mobile_style(); if (weaverii_is_checked_page_opt('ttw-hide-site-title')) { /* best to just do this inline */ echo '<style type="text/css">#site-title,#site-description,#header-extra-html{display:none;}</style>' . "\n"; } weaverii_fix_IE(); echo "\n<!-- End of Weaver II options -->\n"; }
function weaverii_put_widgetarea($area, $style) { // emit ttw widget area depending on various settings (for page.php and index.php) if (weaverii_is_checked_page_opt($area)) { return; } // hide area option checked if ($area != 'mobile-widget-area' && weaverii_use_mobile('mobile') && !weaverii_use_mobile('smalltablet') && weaverii_getopt_checked('wii_mobile_hide_topbottom_widgets')) { return; } if (is_active_sidebar($area)) { /* add top and bottom widget areas */ ob_start(); /* let's use output buffering to allow use of Dynamic Widgets plugin and not have empty sidebar */ $success = dynamic_sidebar($area); $content = ob_get_clean(); if ($success) { ?> <div id="<?php echo $area; ?> " class="widget-area <?php echo $style; ?> " role="complementary"> <?php echo $content; ?> </div><!-- <?php echo $area; ?> --> <?php } } }
function weaverii_compact_post() { return weaverii_getopt('compact_post_formats') || weaverii_is_checked_page_opt('wvr_pwp_compact'); }
<?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly /* Weaver II Inject - injects userdefined HTML inject-infobar - adds both the infobar and the user pre-main area. Order of these two can be swapped easily in a child theme simply by reversing the order here */ if (!weaverii_getopt_checked('wii_infobar_hide') && !weaverii_is_checked_page_opt('wvr-hide-page-infobar')) { // let's really not include it rather than display:none. ?> <div id="infobar"> <?php if (($h1 = weaverii_getopt('wii_info_html1')) != '') { echo '<span id="infobar_html1">'; echo do_shortcode($h1); echo "</span>\n"; } if (!weaverii_getopt_checked('wii_info_hide_breadcrumbs')) { global $weaverii_crumbs; if (function_exists('yoast_breadcrumb')) { $weaverii_crumbs = yoast_breadcrumb('<span id="breadcrumbs">', '</span>', false); } if ($weaverii_crumbs) { echo $weaverii_crumbs;
/** * The default template for displaying content on blog pages * * This will display unmatched post-type blog posts from main blog page and archive-type pages * Note - if you are building a custom content-xxx.php page for a custom post type, you should * be sure that Feature Images are processed correctly via weaverii_the_contnt_featured(). * * @package WordPress * @subpackage Weaver II * @since Weaver II 1.0 */ weaverii_trace_template(__FILE__); global $weaverii_cur_post_id; $weaverii_cur_post_id = get_the_ID(); weaverii_per_post_style(); if (weaverii_is_checked_page_opt('wvr_pwp_compact_posts') && !is_archive() && !is_search() && ($the_image = weaverii_get_first_post_image()) != '') { ?> <article id="post-<?php the_ID(); ?> " <?php post_class('content-default content-compact-post ' . weaverii_post_count_class()); ?> > <header class="entry-header"> <div class="entry-hdr"><h2 class="entry-title"> <a href="<?php esc_url(the_permalink()); ?> " title="<?php printf(esc_attr(__('Permalink to %s', 'weaver-ii')), the_title_attribute('echo=0'));
<?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly /* Weaver II bottom menu - responsive + Javascript class rename */ $mobile_name = apply_filters('weaverii_menu_name', 'mobile_menu', 'bottom'); $primary_name = apply_filters('weaverii_menu_name', 'primary', 'bottom'); $secondary_name = apply_filters('weaverii_menu_name', 'secondary', 'bottom'); $nav_menu = weaverii_use_mobile('mobile') && has_nav_menu($mobile_name) ? $mobile_name : $primary_name; $nav_class = ''; $show_menu = !weaverii_getopt('wii_hide_menu') && !weaverii_is_checked_page_opt('ttw-hide-menus'); if ($show_menu) { if (!weaverii_getopt('wii_move_menu')) { /* ttw - move menu */ echo '<div id="wrap-bottom-menu">' . "\n"; weaverii_mobile_menu_bar('mobile-bottom-nav', 'nav-bottom-menu'); ?> <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr(__('Skip to primary content', 'weaver-ii')); ?> "><?php echo __('Skip to primary content', 'weaver-ii'); ?> </a></div> <div class="skip-link"><a class="assistive-text" href="#sidebar_primary" title="<?php esc_attr(__('Skip to secondary content', 'weaver-ii')); ?>
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 }
weaverii_show_primary_sidebar(); // show default primary widget area // Upper/Right ----------------------- if (!weaverii_is_checked_page_opt('hide_sidebar_right') && !weaverii_replace_right()) { // The Lower/right Widget Area if (is_active_sidebar('right-widget-area')) { ?> <div id="sidebar_right" class="widget-area" role="complementary"> <?php dynamic_sidebar('right-widget-area'); ?> </div><!-- #sidebar_right .widget-area --> <?php } } // Lower/Left ----------------------- if (!weaverii_is_checked_page_opt('hide_sidebar_left') && !weaverii_replace_left()) { // The Upper/Left Widget Area if (is_active_sidebar('left-widget-area')) { ?> <div id="sidebar_left" class="widget-area" role="complementary"> <?php dynamic_sidebar('left-widget-area'); ?> </div><!-- #sidebar_left .widget-area --> <?php } } ?> </div><!-- #sidebar_wrap_left -->
if (strlen($extra) > 0) { // want to display some areas $xarea = 'per-page-' . $extra; // retrieve meta value if (!is_active_sidebar($xarea)) { ?> <h3>*** Note: Per Page widget area: <?php echo $extra; ?> not found. You've likely mistyped the name or haven't defined the area yet. Using default area. ***</h3> <?php $xarea = ''; } } $harea = $xarea ? $xarea : 'header-widget-area'; if (is_active_sidebar($harea) && !(!is_front_page() && !is_home() && weaverii_getopt_checked('_wii_hdr_widg_frontpage')) && !weaverii_is_checked_page_opt('ttw-hide-header-widget')) { // weaver header widget area // header-widget-1 // wii_hdr_widg_1 -- _bgcolor _w_int _w_mobile_int // wii_hdr_widg_bgcolor wii_hdr_widg_h_int wii_hdr_widg_w_int wii_hdr_widg_hide_mobile ?> <div id="sidebar_header" class="sidebar-header"> <?php weaverii_trace_sidebar(__FILE__); // here, we duplicate the functionality of dynamic_sidebar so we can add our own styling for (;;) { // so we can break instead of return global $wp_registered_sidebars, $wp_registered_widgets; $index = sanitize_title($harea); foreach ((array) $wp_registered_sidebars as $key => $value) { if (sanitize_title($value['name']) == $index) {
<?php if (weaverii_show_only_title()) { return; } } ?> <div class="entry-content cf"> <?php echo weaverii_the_contnt_featured(); ?> <?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'weaver-ii') . '</span>', 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php if (!weaverii_compact_post() && !weaverii_is_checked_post_opt('hide_bottom_post_meta') && !weaverii_is_checked_page_opt('ttw_hide_pp_infobot')) { ?> <footer class="entry-utility"> <div class="entry-utility"> <?php printf(__('<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span></span>', 'weaver-ii'), esc_url(get_permalink()), get_the_date('c'), get_the_date(), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'weaver-ii'), get_the_author()), get_the_author()); ?> </div><!-- .entry-utility --> <div class="entry-utility"> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(__(', ', 'weaver-ii')); if ($categories_list) { ?> <span class="cat-links">
function weaveriip_posted_on_code($date, $author) { if (weaverii_getopt('wii_post_info_hide_top') || weaverii_is_checked_page_opt('wvp_perpost_info_hide_top')) { return ''; } $leftm = '8'; $on = "\t<div class=\"entry-meta\" style=\"margin-botom:-5px;margin-top:-10px;\"><div " . weaverii_meta_icons_class() . ">\n\t\t"; $on .= '<span class="sep">Posted on </span><time class="entry-date" >' . $date . '<span class="by-author"> <span class="sep"> by </span> <span class="author vcard">' . $author . '</span></span>'; $on .= "\n </div></div><!-- .entry-meta -->\n"; return $on; }
<?php if (weaverii_show_only_title()) { return; } ?> <div class="entry-content cf"> <?php echo weaverii_the_contnt_featured(); ?> <?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'weaver-ii') . '</span>', 'after' => '</div>')); ?> </div><!-- .entry-content --> <?php if (!weaverii_is_checked_post_opt('hide_top_post_meta') && !weaverii_is_checked_post_opt('hide_bottom_post_meta') && !weaverii_is_checked_page_opt('ttw_hide_pp_infotop') && !weaverii_is_checked_page_opt('ttw_hide_pp_infobot')) { ?> <footer class="entry-utility"> <div class="entry-utility"> <?php printf(__('<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span></span>', 'weaver-ii'), esc_url(get_permalink()), get_the_date('c'), get_the_date(), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'weaver-ii'), get_the_author()), get_the_author()); ?> </div><!-- .entry-utility --> <div class="entry-utility"> <?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(__(', ', 'weaver-ii')); if ($categories_list) { ?> <span class="cat-links"> <?php
// display toggle button weaverii_inject_area('header'); // inject header HTML if (!weaverii_getopt('_wii_hdr_widg_afterimg')) { get_sidebar('header'); } weaveriip_header_insert(); // add W-II Pro injection /* The Dynamic Headers shows headers on a per page basis - will also optionally add site link */ if (function_exists('show_media_header')) { show_media_header(); } // Plugin support: **Dynamic Headers** /* ======== HEADER IMAGE ======== */ global $weaverii_header; if (!(weaverii_is_checked_page_opt('ttw-hide-header-image') && !is_search()) && !(weaverii_getopt_checked('wii_normal_hide_header_image') && !weaverii_use_mobile('mobile')) && !(weaverii_getopt_checked('wii_mobile_hide_header_image') && weaverii_use_mobile('mobile')) || weaverii_getopt_checked('wii_ipad_show_header_image') && weaverii_use_mobile('tablet')) { if (!weaverii_getopt_checked('wii_hide_header_image') && !(weaverii_getopt('wii_hide_header_image_front') && is_front_page())) { echo "\t\t<div id=\"header_image\">\n"; if (weaverii_getopt('wii_link_site_image')) { ?> <a href="<?php echo home_url('/'); ?> " 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 */
* * @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 { get_sidebar('footer'); weaverii_inject_area('footer'); } $date = getdate(); $year = $date['year'];
if (weaverii_getopt('wii_infobar_location') == 'content') { get_template_part('infobar'); } // This will use the global $weaverii_crumbs instead of "current" version echo $page_part2; // and now the page post if (have_posts()) { // same loop as index.php global $weaverii_sticky; weaverii_content_nav('nav-above'); $sticky_posts = false; // really ugly kludge. This code is copied from WP's WP_Query code. If you specify filters, // then the sticky post code is essentially ignored by WP, so we have to do this ourselves. // So - if there are sticky posts, we have to move them to the top of the posts list, and // manually add 'sticky' to the post's class. (1/11/12) if (!weaverii_is_checked_page_opt('ttw_hide_sticky') && (weaverii_get_per_page_value('ttw_category') || weaverii_get_per_page_value('ttw_tag'))) { // move sticky posts when cat or tag filters? // Put sticky posts at the top of the posts array $sticky_posts = get_option('sticky_posts'); global $page; if ($page <= 1 && is_array($sticky_posts) && !empty($sticky_posts)) { $num_posts = count($wp_query->posts); $sticky_offset = 0; // 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));