<?php get_header(); ?>
<div id="content">
<?php if ( is_home() && of_get_option('nivo_slider_disable') == '0' ) : ?>
<?php get_template_part('loop', 'slider'); ?>
<?php endif; ?>
<?php $paged = $wp_query->get('paged');
if( of_get_option('homepage_style') == 'magazine' && !$paged && $paged < 2 ) { ?>
<?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar('Homepage Widget Area') ) : ?>
<p><?php _e('Please set up some Widgets.', 'bodega'); ?></p>
<?php endif; ?>
<?php } else { ?>
<?php if ( is_search() ) : ?>
<?php if ( function_exists('bodega_breadcrumbs') && of_get_option('breadcrumbs_disable') == '0' ) bodega_breadcrumbs(); ?>
<?php endif; ?>
<?php if (have_posts()) : ?>
<div class="widget full-width">
<ul class="post-list col-1">
<?php while (have_posts()) : the_post(); ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : ?>
<a class="post-thumb" href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('thumbnail', array('title' => get_the_title())); ?>
</a>
<?php endif; ?>
<div class="post-body">
<?php if ( get_post_meta($post->ID, 'bo-hide-hot-icon', true) != 'on' ) : ?>
<?php if ( getPostViews(get_the_ID()) >= of_get_option('view_threshold') ) : ?>
<img class="hot-icon" src="<?php echo get_template_directory_uri(); ?>/images/icons/hot_icon.png" alt="Hot!" title="Hot!" />
<?php endif; ?>
<?php endif; ?>
<?php if ( has_post_format('video') ) : ?>
<img class="hot-icon" src="<?php echo get_template_directory_uri(); ?>/images/icons/video_icon.png" alt="Video" title="Video" />
<?php endif; ?>
<?php if ( has_post_format('audio') ) : ?>
<img class="hot-icon" src="<?php echo get_template_directory_uri(); ?>/images/icons/audio_icon.png" alt="Audio" title="Audio" />
<?php endif; ?>
<?php if ( has_post_format('gallery') ) : ?>
<img class="hot-icon" src="<?php echo get_template_directory_uri(); ?>/images/icons/gallery_icon.png" alt="Gallery" title="Gallery" />
<?php endif; ?>
<?php if ( has_post_format('image') ) : ?>
<img class="hot-icon" src="<?php echo get_template_directory_uri(); ?>/images/icons/image_icon.png" alt="Gallery" title="Image" />
<?php endif; ?>
<?php foreach( (get_the_category()) as $category ) :?>
<a class="post-category" href="<?php echo get_category_link($category->cat_ID); ?>"><?php echo "$category->cat_name"?></a>
<?php endforeach; ?>
<h1><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<div class="post-meta">
<span class="post-time"><?php _e('posted ', 'bodega'); the_time(get_option('date_format')); ?></span>
<?php if ( get_post_meta($post->ID, 'bo-show-modified', true) != '0' ) : ?>
<?php if ( get_post_meta($post->ID, 'bo-show-modified', true) == 'time' ) { ?>
<span class="modified-time">(<?php _e('updated ', 'bodega'); the_modified_time(get_option('time_format')); ?>)</span>
<?php } elseif ( get_post_meta($post->ID, 'bo-show-modified', true) == 'date' ) { ?>
<span class="modified-time">(<?php _e('updated ', 'bodega'); the_modified_date(get_option('date_format')); ?>)</span>
<?php } ?>
<?php endif; ?>
<?php if ( get_post_meta($post->ID, 'bo-show-author', true) == 'on' ) : ?>
<span class="post-author">by <?php the_author_posts_link(); ?></span>
<?php endif; ?>
<span>/ <a class="comments-count" href="<?php comments_link(); ?>"><?php comments_number(__('No Comments', 'bodega'), __('1 Comment', 'bodega'), __('% Comments', 'bodega')); ?></a></span>
<?php if ( get_post_meta($post->ID, 'bo-show-view-count', true) == 'on' ) : ?>
<span>/ <?php echo getPostViews(get_the_ID()); _e(' views', 'bodega'); ?></span>
<?php endif; ?>
<?php $show_rating = get_post_meta($post->ID, 'bo-rating-status', true);
if ( $show_rating != 'hide' && !empty($show_rating) ) : ?>
<?php $ratingStatus = get_post_meta($post->ID, 'bo-rating-status', true);?>
<span>/ <?php _e('Rating: ', 'bodega'); ?></span>
<?php if ( get_post_meta($post->ID, 'bo-rating-style', true) == 'number' ) : ?>
<span class="post-rating"><?php echo round(get_post_meta($post->ID, $ratingStatus, true), 2); ?></span>
<?php endif; ?>
<?php if ( get_post_meta($post->ID, 'bo-rating-style', true) == 'stars' ) : ?>
<script type="text/javascript">
jQuery(function() {
jQuery.fn.raty.start(<?php echo get_post_meta($post->ID, $ratingStatus, true); ?>, '#post-rating-<?php the_ID(); ?>');
});
</script>
<span id="post-rating-<?php the_ID(); ?>" class="rating-stars"></span>
<?php endif; ?>
<?php endif; ?>
<div class="separator-short"></div>
</div>
<?php the_excerpt(); ?>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php if ( of_get_option('pagination_style') == 'links' ) { ?>
<div class="cf">
<div class="alignleft"><?php previous_posts_link(__('↠Newer posts', 'bodega')); ?></div>
<div class="alignright"><?php next_posts_link(__('Older posts →', 'bodega')); ?></div>
</div>
<?php } elseif ( of_get_option('pagination_style') == 'numbered' ) { ?>
<?php post_pagination(); ?>
<?php } ?>
</div>
<?php else : ?>
<h2><?php _e('No Posts Found', 'bodega'); ?></h2>
<?php endif; ?>
<?php } ?>
</div>
<div id="sidebar">
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>