/** * print the filter for the portfolio * * @param array $args [description] * @return [type] [description] */ private function worklist() { // TODO: get_query_var( 'paged' ) is given by codex, but not working in this case? $paged = get_query_var('page') ? get_query_var('page') : 1; $portfolio_query = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => $this->settings['limit'] ? $this->settings['limit'] : -1, 'paged' => $paged, 'meta_key' => '_thumbnail_id')); if ($portfolio_query->have_posts()) { echo '<div class="portfolio-list">'; $i = 1; while ($portfolio_query->have_posts()) { $portfolio_query->the_post(); $data_class = ''; $terms = wp_get_post_terms(get_the_ID(), 'portfolio_category', array('fields' => 'all')); foreach ($terms as $term) { $data_class .= $term->slug . ' '; } echo '<div data-id="' . $i . '" class="item preview-box ' . $data_class . '">'; $preview_args = array('src' => false, 'width' => $this->settings['img_width'], 'height' => $this->settings['img_height'], 'crop' => true, 'effect' => $this->settings['effect'], 'module' => 'portfolio'); echo inferno_preview($preview_args); echo '</div>'; $i++; } echo '<div class="clear clearfix"></div>'; echo '</div>'; if ($this->settings['paginate'] == true) { echo '<div class="pagination">'; echo '<div class="next">'; next_posts_link(__('Older entries', 'inferno'), $portfolio_query->max_num_pages); echo '</div><div class="prev">'; previous_posts_link(__('Newer entries', 'inferno')); echo '</div>'; echo '</div>'; } } wp_reset_postdata(); }
<div class="preview-box type-work <?php echo $width . $lastclass; ?> "> <?php echo inferno_preview($preview_args); ?> some text below the preview thumb </div>
<div class="preview-box type-post <?php echo $width . $lastclass; ?> "> <h3><?php the_title(); ?> </h3> <?php echo inferno_preview(false, $img_width, $img_height, true, true, $effect, 'post'); ?> <?php the_excerpt(); ?> </divz