<footer class="article-footer"> </footer> </article> <?php } ?> <?php if (function_exists('bones_page_navi')) { ?> <?php bones_page_navi(); ?> <?php } else { ?> <nav class="wp-prev-next"> <ul class="clearfix"> <li class="prev-link"><?php next_posts_link(__('« Older Entries', 'anp-main-theme')); ?> </li> <li class="next-link"><?php previous_posts_link(__('Newer Entries »', 'anp-main-theme')); ?> </li> </ul>
function grid_blog($atts, $content = null) { extract($atts); switch ($columns) { case 3: $column_class = 'span4'; $mod = 3; break; case 2: $column_class = 'span6'; $mod = 2; break; case 1: $column_class = 'span12'; $mod = 1; break; default: $column_class = 'span3'; $mod = 4; break; } $this->get_query($atts); global $wp_query; $total_num_posts = $wp_query->post_count; $count = 0; ?> <div class="row-fluid adap-blog-layout-grid"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php $count++; if ($count % $mod == 0 && $count != $total_num_posts) { $new_row = true; } else { $new_row = false; } $curr_post['id'] = get_the_ID(); $curr_post['title'] = get_the_title(); $curr_post['content'] = get_the_content(); $curr_post['featured'] = ''; $curr_post['feature_size'] = 'medium'; $img_size = $columns == 1 ? 'full' : 'large'; $curr_post['featured'] = get_the_post_thumbnail(get_the_ID(), $img_size); // $curr_post = apply_filters('adap_post_formatting', $curr_post); ?> <section class="post-preview <?php echo $column_class; ?> thumbnail"> <article <?php post_class('clearfix'); ?> role="article" class="thumbnail"> <header class="article-header"> <?php echo $curr_post['featured']; ?> <?php if ($grid_show_title != 'false') { ?> <h1 class="h2"><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title_attribute(); ?> "><?php echo $curr_post['title']; ?> </a> </h1> <?php } ?> <?php if ($grid_show_meta != 'false') { ?> <p class="byline vcard"><?php printf(__('Posted <time class="updated" datetime="%1$s">%2$s</time> by <span class="author">%3$s</span> <span class="amp">&</span> filed under %4$s.', 'adap_sc'), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), bones_get_the_author_posts_link(), get_the_category_list(', ')); ?> </p> <?php } ?> </header> <!-- end article header --> <div class="entry-content clearfix"> <?php if ($grid_show_excerpt != 'false') { the_excerpt(); } ?> </div> <!-- end article section --> <footer class="article-footer"> <p class="tags"><?php the_tags('<span class="tags-title">' . __('Tags:', 'adap_sc') . '</span> ', ', ', ''); ?> </p> </footer> <!-- end article footer --> <?php // comments_template(); // uncomment if you want to use them ?> </article> <!-- end article --> </section> <?php if ($new_row) { ?> </div> <div class="row-fluid"> <?php } ?> <?php } ?> <?php if (function_exists('bones_page_navi')) { ?> <?php bones_page_navi('', '', 'Newer Posts', 'Older Posts'); ?> <?php } else { ?> <nav class="wp-prev-next"> <ul class="clearfix"> <li class="prev-link"><?php next_posts_link(__('« Older Entries', 'adap_sc')); ?> </li> <li class="next-link"><?php previous_posts_link(__('Newer Entries »', 'adap_sc')); ?> </li> </ul> </nav> <?php } ?> <?php } else { ?> <article id="post-not-found" class="hentry clearfix"> <header class="article-header"> <h1><?php _e("Oops, Post Not Found!", 'adap_sc'); ?> </h1> </header> <section class="entry-content"> <p><?php _e("Uh Oh. Something is missing. Try double checking things.", 'adap_sc'); ?> </p> </section> <footer class="article-footer"> <p><?php _e("This is the error message from the Adaptive Shortcodes' Blog Shortcode ", 'adap_sc'); ?> </p> </footer> </article> <?php } ?> </div> <?php $ret_val = ob_get_contents(); ob_end_clean(); wp_reset_query(); return $ret_val; }
<p> <time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time(get_option('date_format')); ?></time> </p> </div> </section> <!-- end article section --> </header> <!-- end article header --> </article> <!-- end article --> <?php endwhile; ?> <!-- TODO: Erase bones_page_navi stuff on the home page <?php if (function_exists('bones_page_navi')) { // if experimental feature is active ?> <?php bones_page_navi(); // use the page navi function ?> <?php } else { // if it is disabled, display regular wp prev & next links ?> <nav class="wp-prev-next"> <ul class="clearfix"> <li class="prev-link"><?php next_posts_link(_e('« Older Entries', 'bonestheme')) ?></li> <li class="next-link"><?php previous_posts_link(_e('Newer Entries »', 'bonestheme')) ?></li> </ul> </nav> <?php } ?> --> <?php else : ?> <article id="post-not-found" class="hentry clearfix"> <header class="article-header">
<?php _e('Sorry, no results were found.', 'sage'); ?> </div> <?php get_search_form(); ?> <?php } ?> <?php while (have_posts()) { the_post(); //Only show posts not case-studies or other post types if (get_post_type(get_the_ID()) == 'post') { get_template_part('templates/content', get_post_type() != 'post' ? get_post_type(get_the_ID()) : get_post_format()); } ?> <?php } ?> </div><!--.contents--> </section><!--.content--> <?php bones_page_navi('', '', $wp_query); ?> <div class="clear-fix">
function shortcode_handler($atts, $content = null) { wp_enqueue_script('adap-isotope', AdapCommon::get_base_url() . '/js/lib/isotope/jquery.isotope.min.js', array('jquery'), false, true); wp_enqueue_script('adap-portfolio', AdapCommon::get_base_url() . '/js/adap-portfolio.js', array('adap-isotope'), false, true); ob_start(); $atts = $this->getPreparedAtts($atts, $content); $atts = shortcode_atts(array('items' => '10', 'paginate' => 'yes', 'categories' => '', 'post_type' => 'portfolio', 'taxonomy' => 'portfolio_category', 'display' => 'content', 'columns' => '4', 'show_all_text' => 'Show All', 'show_title' => true, 'show_excerpt' => true, 'show_pagination' => true, 'show_item_categories' => true, 'show_filters' => true, 'filter_display' => 'text', 'link_behavior' => 'lightbox', 'order' => 'DESC', 'orderby' => 'date', 'generate_thumbnail' => 'true', 'exclude' => ''), $atts); extract($atts); $this->do_query($atts); ?> <?php if (have_posts()) { ?> <?php $categories = $this->getCurrentCategories($categories, $taxonomy); switch ($columns) { case 3: $column_class = 'one-third span4'; $img_size = 'portfolio-three-column'; break; case 2: $column_class = 'one-half span6'; $img_size = 'portfolio-two-column'; break; case 1: $column_class = 'whole span12'; $img_size = 'portfolio-one-column'; break; default: $column_class = 'one-fourth span3'; $img_size = 'portfolio-four-column'; break; } if ($generate_thumbnail == 'false') { $img_size = 'full'; } $pp_gallery_string = sprintf('rel="prettyPhoto[%s]"', uniqid('gallery-')); $show_icon = $filter_display != 'icon' ? 'false' : 'true'; $filter_icon_class = 'show-icon-' . $show_icon; ?> <div class="adap-portfolio"> <?php if ($show_filters != 'false') { ?> <ul class="filters <?php echo $filter_icon_class; ?> "> <li><a title="<?php echo $show_all_text; ?> " href="#" class="filter-link active" data-filter="*"> <?php if ($show_icon != 'false') { ?> <i class="portfolio-category-icon icon-asterisk"></i> <?php } else { echo $show_all_text; } ?> </a></li> <?php foreach ($categories as $cat) { $this->printFilterMarkup($cat, $show_icon); } ?> </ul> <?php } ?> <div class="portfolio-thumbs"> <?php //make the_content() respect <!--more--> tags //by setting the global "$more" value. global $more; $orig_more = $more; $more = 0; //we remove this handler before we process the content //so we don't get an infinite loop remove_shortcode($this->sc_handle); add_shortcode($this->sc_handle, array($this, 'nested_portfolio_shortcode_handler')); ?> <?php while (have_posts()) { the_post(); ?> <?php global $post; $pid = $post->ID; $a_class = ''; $permalink = get_permalink(); $href = $permalink; $external_link = get_post_meta($pid, '_adap_sc_external_link_override', true); $external_link = trim($external_link); if ($external_link && $external_link != '') { $href = $external_link; } ?> <div class="portfolio-item <?php echo $column_class; ?> <?php $this->printCategoryClasses($pid, $taxonomy); ?> "> <div class="thumbnail"> <div class="portfolio-image-preview"> <div class="image-overlay"> <div class="image-overlay-inner"> <?php if (has_post_thumbnail()) { wp_enqueue_script('prettyphoto'); wp_enqueue_style('prettyphoto'); $lb_href = wp_get_attachment_image_src(get_post_thumbnail_id($pid), 'large'); $lb_href = $lb_href[0]; $custom_link = get_post_meta($pid, '_adap_sc_link_override', true); $custom_link = trim($custom_link); if ($custom_link && $custom_link != '') { $lb_href = $custom_link; } if ($lb_href) { ?> <a title="<?php the_title(); ?> " class="prettyphoto portfolio-lightbox-link" href="<?php echo $lb_href; ?> " <?php echo $pp_gallery_string; ?> ><i class="entypo-eye"></i> </a> <?php } } ?> <a title="<?php the_title(); ?> " href="<?php echo $href; ?> " <?php echo $a_class; ?> ><i class="entypo-link"></i></a> </div> </div> <div class="image-wrapper invisible"> <?php echo get_the_post_thumbnail($pid, $img_size); ?> </div> </div> <?php if ($show_title != 'false') { ?> <h3 class="portfolio-preview-title"><a href="<?php echo $permalink; ?> "><?php the_title(); ?> </a></h3> <?php } ?> <?php if ($show_item_categories !== 'false') { echo '<div class="portfolio-categories">'; echo get_the_term_list($pid, $taxonomy, '', ', ', ''); echo '</div>'; } ?> <?php if ($show_excerpt != 'false') { ?> <div class="portfolio-item-excerpt"> <?php echo get_the_excerpt(); ?> </div> <?php } ?> </div> </div> <?php } ?> <?php //replace the portfolio handling remove_shortcode($this->sc_handle); $this->register_shortcode(); $more = $orig_more; ?> </div> <!--End Thumbnails--></div> <?php if ($show_pagination != 'false') { ?> <?php if (function_exists('bones_page_navi')) { ?> <div class="portfolio-pagination-links"> <?php bones_page_navi(); ?> </div> <?php } else { ?> <nav class="wp-prev-next"> <ul class="clearfix"> <li class="prev-link"><?php next_posts_link(__('« Older Entries', 'adap_sc')); ?> </li> <li class="next-link"><?php previous_posts_link(__('Newer Entries »', 'adap_sc')); ?> </li> </ul> </nav> <?php } ?> <?php } ?> <?php } else { ?> <article id="post-not-found" class="hentry clearfix"> <header class="article-header"> <h1><?php _e("Oops, Post Not Found!", 'adap_sc'); ?> </h1> </header> <section class="entry-content"> <p><?php _e("Uh Oh. Something is missing. Try double checking things.", 'adap_sc'); ?> </p> </section> </article> <?php } ?> <?php $ret_val = ob_get_contents(); ob_end_clean(); wp_reset_query(); return $ret_val; }