コード例 #1
0
 public function init()
 {
     // Add "more" text for excerpts
     //Bunyad::posts()->more_html = '<span class="read-more arrow"><a href="%s" title="%s">&rarr;</a></span>';
     Bunyad::core()->add_body_class('skin-tech');
     add_filter('bunyad_css_generator_cat', array($this, 'add_dynamic_css'));
     // Set listing meta position to below title in this skin
     Bunyad::options()->meta_position = 'below';
     add_filter('bunyad_featured_image', array($this, 'adjust_specific_images'), 10, 3);
 }
コード例 #2
0
        setup_postdata($post);
        ?>
		
			<li class="highlights column one-third">
				
				<article>
						
					<a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title_attribute();
        ?>
" class="image-link">
						<?php 
        the_post_thumbnail(Bunyad::core()->get_sidebar() == 'none' ? 'main-block' : 'gallery-block', array('class' => 'image', 'title' => strip_tags(get_the_title())));
        ?>
	
						<?php 
        if (get_post_format()) {
            ?>
							<span class="post-format-icon <?php 
            echo esc_attr(get_post_format());
            ?>
"><?php 
            echo apply_filters('bunyad_post_formats_icon', '');
            ?>
</span>
						<?php 
        }
        ?>
コード例 #3
0
					
			</article>
			
			<?php 
    // add next/previous
    get_template_part('partials/single/post-navigation');
    // add author box
    get_template_part('partials/single/author-box');
    // add related posts
    get_template_part('partials/single/related-posts');
    ?>
	
			<div class="comments">
				<?php 
    comments_template('', true);
    ?>
			</div>
	
		</div>
	
		<?php 
    Bunyad::core()->theme_sidebar();
    ?>
	
	</div> <!-- .row -->

</div> <!-- .post-wrap -->

<?php 
}
// end of "the loop"
コード例 #4
0
	<?php 
/**
 * Get the selected header template
 * 
 * Note: Default is partials/header/layout.php
 */
get_template_part('partials/header/layout', Bunyad::options()->header_style);
?>
	
<?php 
if (!Bunyad::options()->disable_breadcrumbs) {
    ?>
	<div <?php 
    Bunyad::markup()->attribs('breadcrumbs-wrap', array('class' => array('breadcrumbs-wrap')));
    ?>
>
		
		<div class="wrap">
		<?php 
    Bunyad::core()->breadcrumbs();
    ?>
		</div>
		
	</div>
<?php 
}
?>

<?php 
do_action('bunyad_pre_main_content');
コード例 #5
0
 /**
  * Product listing columns in WooCommerce
  */
 public function columns()
 {
     return Bunyad::core()->get_sidebar() == 'none' ? 4 : 3;
 }
コード例 #6
0
$loop_grid = Bunyad::registry()->loop_grid;
if (!isset($loop_grid_class)) {
    $loop_grid_class = $loop_grid ? 'grid-' . $loop_grid : '';
}
if ($bunyad_loop->have_posts()) {
    $attribs = array('class' => array('row listing', 'grid-overlay', $loop_type, $loop_grid_class));
    // infinite load?
    if (Bunyad::options()->pagination_type == 'infinite') {
        $attribs['data-infinite'] = Bunyad::markup()->unique_id('listing-');
    }
    /**
     * Select the image to use 
     */
    if (!isset($loop_image)) {
        // set larger image when full-width, for 2-col grid
        $image = Bunyad::core()->get_sidebar() == 'none' ? 'main-slider' : 'grid-overlay';
        if ($loop_grid) {
            // change image to smaller
            $image = 'grid-overlay';
        }
    } else {
        $image = $loop_image;
    }
    // Loop grid column class
    if (!isset($loop_column)) {
        $loop_column = $loop_grid == 3 ? 'one-third' : 'half';
    }
    ?>
	
	<div <?php 
    Bunyad::markup()->attribs('loop', $attribs);
コード例 #7
0
			
				<a href="<?php 
        echo $url;
        ?>
" title="<?php 
        the_title_attribute();
        ?>
" itemprop="image">
				
				<?php 
        if (Bunyad::options()->blog_thumb != 'thumb-left') {
            // normal container width image
            ?>
				
					<?php 
            if (!in_the_loop() && Bunyad::posts()->meta('layout_style') == 'full' or Bunyad::core()->get_sidebar() == 'none') {
                // largest images - no sidebar?
                ?>
				
						<?php 
                the_post_thumbnail('main-full', array('title' => strip_tags(get_the_title())));
                ?>
				
					<?php 
            } else {
                ?>
					
						<?php 
                the_post_thumbnail('main-slider', array('title' => strip_tags(get_the_title())));
                ?>
					
コード例 #8
0
</a></span>
			<?php 
        }
        ?>
			
			<article itemscope itemtype="http://schema.org/Article">
					
				<a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title_attribute();
        ?>
" class="image-link" itemprop="url">
					<?php 
        the_post_thumbnail(Bunyad::core()->get_sidebar() != 'none' && $column == '1/3' ? 'gallery-block' : (Bunyad::core()->get_sidebar() == 'none' ? 'main-slider' : 'main-block'), array('class' => 'image', 'title' => strip_tags(get_the_title()), 'itemprop' => 'image'));
        ?>
					
					<?php 
        if (get_post_format()) {
            ?>
						<span class="post-format-icon <?php 
            echo esc_attr(get_post_format());
            ?>
"><?php 
            echo apply_filters('bunyad_post_formats_icon', '');
            ?>
</span>
					<?php 
        }
        ?>
コード例 #9
0
<?php

/**
 * "loop" to display posts when using an existing query. Used for categories and arhives.
 * 
 * Uses loop-grid-overlay.php code. 
 */
Bunyad::registry()->loop_grid = 3;
$loop_type = 'tall-overlay';
$loop_image = 'tall-overlay';
$loop_column = Bunyad::core()->get_sidebar() == 'none' ? 'one-fourth' : 'one-third';
$loop_grid_class = Bunyad::core()->get_sidebar() == 'none' ? 'grid-4' : '';
include locate_template('loop-grid-overlay.php');
コード例 #10
0
    $bunyad_loop_template = 'loop-timeline';
    $category = get_category(get_query_var('cat'), false);
    $cat_meta = Bunyad::options()->get('cat_meta_' . $category->term_id);
    if (empty($cat_meta['per_page'])) {
        query_posts(array('cat' => $category->term_id, 'posts_per_page' => -1));
    }
} else {
    if (in_array($cat_meta['template'], array('alt', 'classic', 'grid-overlay', 'grid-overlay-3', 'tall-overlay'))) {
        $bunyad_loop_template = 'loop-' . str_replace('-3', '', $cat_meta['template']);
    } else {
        $bunyad_loop_template = 'loop';
    }
    // set loop grid type
    $loop_grid = '';
    if (in_array($cat_meta['template'], array('modern-3', 'grid-overlay-3'))) {
        $loop_grid = 3;
    }
    Bunyad::registry()->set('loop_grid', $loop_grid);
}
// have a sidebar preference?
if (!empty($cat_meta['sidebar'])) {
    Bunyad::core()->set_sidebar($cat_meta['sidebar']);
}
// enable infinite scroll?
if (!empty($cat_meta['pagination_type'])) {
    // normal is default - empty in options
    Bunyad::options()->set('pagination_type', $cat_meta['pagination_type'] == 'normal' ? '' : $cat_meta['pagination_type']);
}
get_template_part('archive');
// restore modified options
Bunyad::options()->set_all($options);
コード例 #11
0
 /**
  * Action callback: Add classes to body
  */
 public function add_body_classes()
 {
     // Add body class for pages with slider
     if (is_page() && Bunyad::posts()->meta('featured_slider')) {
         Bunyad::core()->add_body_class('has-featured');
     }
     // Add body class for archives with slider
     if (is_category()) {
         $meta = Bunyad::options()->get('cat_meta_' . get_query_var('cat'));
         if (!empty($meta['slider'])) {
             Bunyad::core()->add_body_class('has-featured');
         }
     }
     // Add navigation style, such as has-nav-light
     Bunyad::core()->add_body_class('has-' . (Bunyad::options()->nav_style ? Bunyad::options()->nav_style : 'nav-dark'));
     // Add navigation layout style, such has has-nav-full
     if (Bunyad::options()->nav_layout) {
         Bunyad::core()->add_body_class('has-' . Bunyad::options()->nav_layout);
     }
     // Add mobile header style class
     if (Bunyad::options()->mobile_header == 'modern') {
         Bunyad::core()->add_body_class('has-mobile-head');
     }
 }
コード例 #12
0
 /**
  * Custom CSS for pages and posts that shouldn't be cached through css-compiler.php because 
  * the size will increase exponentially.
  * 
  */
 public function add_per_page($return = false)
 {
     if (!is_admin() && is_singular() && Bunyad::posts()->meta('bg_image')) {
         $bg_type = Bunyad::posts()->meta('bg_image_bg_type');
         $the_css = 'background: url("' . esc_attr(Bunyad::posts()->meta('bg_image')) . '");';
         if (!empty($bg_type)) {
             if ($bg_type == 'cover') {
                 $the_css .= 'background-repeat: no-repeat; background-attachment: fixed; background-position: center center; ' . '-webkit-background-size: cover; -moz-background-size: cover;-o-background-size: cover; background-size: cover;';
             } else {
                 $the_css .= 'background-repeat: ' . esc_attr($bg_type) . ';';
             }
         }
         $the_css = 'body.boxed { ' . $the_css . ' }';
         // return the css?
         if ($return) {
             return $the_css;
         }
         // or enqueue it for inline css
         Bunyad::core()->enqueue_css(wp_style_is('custom-css', 'enqueued') ? 'custom-css' : 'smartmag-core', $the_css);
     }
 }
コード例 #13
0
    $bunyad_loop = $wp_query;
}
if ($bunyad_loop->have_posts()) {
    $attribs = array('class' => array('row listing', 'meta-' . Bunyad::options()->meta_position));
    // infinite load?
    if (Bunyad::options()->pagination_type == 'infinite') {
        $attribs['data-infinite'] = Bunyad::markup()->unique_id('listing-');
    }
    // set larger image when full-width, for 2-col grid
    $image = Bunyad::core()->get_sidebar() == 'none' ? 'main-slider' : 'main-block';
    // grid type
    $loop_grid = Bunyad::registry()->loop_grid;
    if ($loop_grid) {
        $attribs['class'][] = 'grid-' . $loop_grid;
        // change image to smaller
        $image = Bunyad::core()->get_sidebar() == 'none' ? 'main-block' : 'gallery-block';
    }
    ?>
	
	<div <?php 
    Bunyad::markup()->attribs('loop', $attribs);
    ?>
>
		
		<?php 
    while ($bunyad_loop->have_posts()) {
        $bunyad_loop->the_post();
        ?>
			
		<div class="column <?php 
        echo $loop_grid == 3 ? 'one-third' : 'half';