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_get_page_layout($who) { // determine the layout structure of a page from the settings. // blogs, pages, and single will use the 'right-1-col' as a default // others will be 'none' - no sidebars - by default // each page can be set to its own default. Individual pages // can be set to a layout on a per-page basis. $default = weaverii_getopt('wii_layout_default'); if (!$default) { $default = 'right-1-col'; } // use something! $arc_default = weaverii_getopt('wii_layout_default_archive'); if (!$arc_default) { $arc_default = 'one-column'; } // use something! $per_page = weaverii_get_per_page_value('wvr_page_layout'); if ($per_page != '') { return $per_page; } switch ($who) { case 'index': case 'pwp': $l = weaverii_getopt('wii_layout_blog'); return !$l || $l == 'default' ? $default : $l; case 'single': if (weaverii_is_checked_post_opt('ttw_hide_sidebars')) { return 'one-column'; } $l = weaverii_getopt('wii_layout_single'); return !$l || $l == 'default' ? $default : $l; case 'page': $l = weaverii_getopt('wii_layout_page'); return !$l || $l == 'default' ? $default : $l; case 'archive': $l = weaverii_getopt('wii_layout_archive'); return !$l || $l == 'default' ? $arc_default : $l; case 'author': $l = weaverii_getopt('wii_layout_author'); return !$l || $l == 'default' ? $arc_default : $l; case 'category': $l = weaverii_getopt('wii_layout_category'); return !$l || $l == 'default' ? $arc_default : $l; case 'tag': $l = weaverii_getopt('wii_layout_tag'); return !$l || $l == 'default' ? $arc_default : $l; case 'search': case '404': $l = weaverii_getopt('wii_layout_search'); return !$l || $l == 'default' ? $arc_default : $l; case 'image': $l = weaverii_getopt('wii_layout_image'); return !$l || $l == 'default' ? $arc_default : $l; default: return $default; } return $default; }
function weaverii_get_page_author() { $author = weaverii_get_per_page_value('ttw_author'); if (empty($author)) { return ''; } return $author; }
weaverii_post_title('<div class="entry-hdr"><h2 class="entry-title">', "</h2></div>\n"); } if ('page' != get_post_type()) { ?> <div class="entry-meta"> <?php weaverii_post_top_info(); ?> </div><!-- .entry-meta --> <?php } weaverii_comments_popup_link(); ?> </header><!-- .entry-header --> <?php if (weaverii_get_per_page_value('wvr_pwp_type') == 'title_featured' && !weaverii_sc_getopt('showposts') || weaverii_sc_getopt('show') == 'title_featured') { // title has been displayed - add the featured image after for these special cases echo '<div class="entry-content cf">'; weaverii_use_fi_in_content(); echo '</div>'; } if (weaverii_show_only_title()) { return; } if (weaverii_do_excerpt()) { ?> <div class="entry-summary"> <!-- EXCERPT --> <?php weaverii_the_excerpt_featured(); ?> </div><!-- .entry-summary -->
function widget($args, $instance) { extract($args); $title = weaverii_get_per_page_value('wvr_pp_title'); $text = weaverii_get_per_page_value('wvr_pp_text'); if (empty($title) && empty($text)) { return; } echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } echo do_shortcode($text); echo $after_widget; }
function weaverii_masonry($act = false) { global $weaverii_cur_template; $is_pt = false; if (strpos($weaverii_cur_template, 'paget-posts.php') !== false) { $is_pt = true; } if (is_singular() && !$is_pt) { // don't emit anything for non-blog pages return false; } $usem = weaverii_get_per_page_value('wvr_pwp_masonry'); // per page to override... if ($usem < 2) { $usem = weaverii_getopt('masonry_cols'); } if ($usem < 2) { return false; } switch ($act) { case 'begin-posts': // wrap all posts echo '<div id="blog-posts" class="cf">'; break; case 'begin-post': // wrap one post global $weaverii_cur_post_id; $weaverii_cur_post_id = get_the_ID(); // we need to know now if (weaverii_is_checked_post_opt('wvr_masonry_span2')) { // span 2 columns $usem .= '-span-2'; } echo '<div class="cf blog-post blog-post-cols-' . $usem . '">'; // for masonry break; case 'end-post': // end of one post echo "</div> <!-- .blog-post -->\n"; break; case 'end-posts': // end of all posts echo '</div> <!-- #blog-posts -->' . "\n"; break; case 'invoke-code': ?> <script type='text/javascript'> jQuery(function(){var $container=jQuery('#blog-posts');$container.imagesLoaded(function(){ $container.masonry({itemSelector:'.blog-post'});});}); jQuery(window).resize(function(){jQuery('#blog-posts').masonry({itemSelector:'.blog-post'});}); </script> <?php break; case 'enqueue-script': wp_enqueue_script('jquery-masonry', null, array('jquery'), null, true); //$url = trailingslashit(get_template_directory_uri()); //wp_enqueue_script('weaverMasonry', $url.'includes/pro/masonry/jquery.masonry.min.js',array(),WEAVERII_VERSION); break; } // end switch return true; }
post_class('content-page'); ?> > <header class="entry-header<?php weaverii_hide_page_title(); ?> "> <h1 class="entry-title"><?php the_title(); ?> </h1> </header><!-- .entry-header --> <div class="entry-content cf"> <?php if (($ex = weaverii_get_per_page_value('html_source_intro')) != '') { echo do_shortcode($ex); echo '<hr />'; } ?> <pre class="prettyprint lang-html"> <?php echo esc_html(get_the_content()); ?> </pre> <?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'weaver-ii') . '</span>', 'after' => '</div>')); ?> </div><!-- .entry-content --> <footer class="entry-utility-page">
// default $pp = weaverii_get_per_page_value('wvr_pwp_cols'); if ($pp) { $num_cols = $pp; } if (weaverii_use_mobile('mobile')) { $num_cols = 1; } 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 $hide_n_posts = weaverii_get_per_page_value('wvr_hide_n_posts'); if ($hide_n_posts == '' || $hide_n_posts < 1 || $hide_n_posts > 100) { $hide_n_posts = 0; } weaverii_post_count_clear(); $col = 0; while (have_posts()) { the_post(); weaverii_post_count_bump(); if (weaverii_post_count() <= $hide_n_posts) { global $page, $paged; if (!($paged >= 2 || $page >= 2)) { continue; // skip posting } }