<?php /** * The Sidebar containing the main widget areas. * * @package Bad Weather */ ?> <?php if (Bw::get_meta('page_layout') == 'right' or is_search() or is_category() or basename(@get_page_template()) == 'custom-page-builder.php' or get_post_type() == 'post' && Bw::get_meta('page_layout') !== 'full' or Bw_woo::woo_active_plugin() and is_shop() and Bw_woo::post_meta_shop('page_layout') == 'right' or Bw_woo::woo_active_plugin() and is_product_category() and Bw_woo::post_meta_shop('page_layout') == 'right') { ?> <div id="sidebar" class="<?php echo basename(get_page_template()) == 'custom-page-builder.php' ? 'custom' : ''; ?> "> <?php $sidebar = Bw_woo::is_woo() ? 'sidebar-shop' : 'sidebar-1'; ?> <?php if (!dynamic_sidebar($sidebar)) { ?> <aside id="search" class="widget widget_search"> <?php get_search_form(); ?> </aside>
<div id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <h1><?php the_title(); ?> </h1> <ul> <?php foreach (Bw::gallerize_by_id(Bw::get_meta('bw_gallery')) as $image) { ?> <li> <img src="<?php echo $image['thumb'][0]; ?> " alt="<?php echo $image['title']; ?> "> </li> <?php } ?> </ul>
* The template used for displaying page content in page.php * * @package Bad Weather */ ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php if (!Bw::get_meta('hide_title')) { ?> <div class="heading"> <h1 class="page-title"><?php the_title(); ?> </h1> </div> <?php } ?> <?php the_content(); ?>
static function content_class() { $content_class = ''; switch (true) { case is_single() and Bw::get_meta('page_layout') == 'full': $content_class .= 'full'; break; case is_single(): $content_class .= 'right'; break; case is_archive(): $content_class .= 'right'; break; case get_post_type() == 'post': $content_class .= 'right'; break; default: $content_class .= Bw::the_meta('page_layout'); break; } echo $content_class; }
} ?> <?php if (Bw::get_meta('bw_gallery')) { ?> <div class="bw-slider-holder gallery"> <ul class="post-gallery bw-slider slider-pagination <?php echo $slider_options; ?> " data-effect="<?php echo $slider_effect; ?> "> <?php foreach (Bw::gallerize_by_id(Bw::get_meta('bw_gallery'), Bw::get_meta_checkbox('auto_height') ? 'bw_700' : 'bw_980x600') as $image) { ?> <li class="item"> <div class="article-thumb"> <img src="<?php echo $image['thumb'][0]; ?> " alt="<?php echo $image['title']; ?> "> </div> </li> <?php } ?>
<?php $migh_like_cat = array(); $cats = get_the_category(); foreach ($cats as $cat) { $migh_like_cat[] = $cat->slug; } $new_cats = count($migh_like_cat) > 0 ? implode(",", $migh_like_cat) : ''; $num_posts = Bw::get_meta('page_layout', get_the_ID()) == 'full' ? 3 : 2; $q = new WP_Query(array('orderby' => 'rand', 'posts_per_page' => $num_posts, 'category_name' => implode(",", $migh_like_cat), 'post__not_in' => array(get_the_ID()), 'meta_key' => '_thumbnail_id')); echo '<div class="posts-grid-holder inner related-articles full">'; echo '<div class="posts-grid bw-over">'; while ($q->have_posts()) { $q->the_post(); get_template_part('templates/post-templates/content-grid'); } wp_reset_query(); echo '</div></div>'; echo '<hr class="border" style="margin:10px 0 0;">';