post_class('clearfix'); ?> > <?php get_template_part('content', get_post_format()); ?> </article><!-- end .hentry --> <?php } ?> <?php echo ss_framework_pagination(); ?> <?php } else { ?> <article id="post-0" class="post no-results not-found"> <h3><?php _e('It seems we can’t find what you’re looking for...', 'ss_framework'); ?> </h3> </article><!-- end .hentry -->
function ss_framework_portfolio_sc($atts) { $atts = extract(shortcode_atts(array('columns' => 'one-fourth', 'limit' => -1, 'categories' => '', 'pagination' => 'yes'), $atts)); global $post; if ($pagination == 'yes') { $paged = get_query_var('paged') ? get_query_var('paged') : 1; } $args = array('post_type' => 'portfolio', 'posts_per_page' => esc_attr($limit), 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'paged' => isset($paged) ? $paged : 1); if ($categories) { $categories = explode(',', $categories); foreach ($categories as $i => $category) { $category_slugs[$i] .= get_term($category, 'portfolio-categories')->slug; } $categories = implode(',', $category_slugs); $args = array_merge($args, array('portfolio-categories' => esc_attr($categories))); } query_posts($args); if (have_posts()) { $output = '<section id="portfolio-items" class="clearfix">'; $lightbox = of_get_option('ss_portfolio_lightbox'); if ($lightbox == '1') { $lightbox_class = ' class="single-image"'; } else { $lightbox_class = null; } while (have_posts()) { the_post(); // Remove any old data $data_categories = null; $category_names = null; $categories = get_the_terms($post->ID, 'portfolio-categories'); if ($categories) { foreach ($categories as $category) { $data_categories .= $category->slug . ' '; $category_names .= strtolower($category->name) . ' / '; } } $post_thumbnail_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'portfolio-' . esc_attr($columns)); $post_thumbnail_data = ss_framework_get_the_post_thumbnail_data($post->ID); if ($lightbox == '1') { $permalink = $post_thumbnail_data['src']; } else { $permalink = get_permalink(); } $output .= '<article class="' . esc_attr($columns) . '" data-categories="' . trim($data_categories) . '">'; if ($post_thumbnail_img) { $output .= '<a href="' . $permalink . '" title="' . get_the_title() . '"' . $lightbox_class . '>'; $output .= '<img src="' . $post_thumbnail_img[0] . '" alt="' . $post_thumbnail_data['alt'] . '" class="entry-image ' . $post_thumbnail_data['class'] . '">'; $output .= '</a>'; } $output .= '<a href="' . get_permalink() . '" class="project-meta">'; $output .= '<h5 class="title">' . get_the_title() . '</h5>'; $output .= '<span class="categories">' . substr(trim($category_names), 0, -2) . '</span>'; $output .= '</a>'; $output .= '</article><!-- end project -->'; } $output .= '</section><!-- end #portfolio-items -->'; if ($pagination == 'yes') { $output .= ss_framework_pagination(); } wp_reset_query(); } return $output; }