<!-- Start Related Posts --> <?php global $post; $postId = $post->ID; $format = get_post_meta($postId, 'portfolio_type', true); $layout = get_post_meta($postId, 'portfolio_layout', true); $type = get_post_meta($postId, 'portfolio_type', true); if (is_singular('post')) { $query = get_blog_posts_related_by_category($postId); } elseif (is_singular('portfolio')) { $query = get_posts_related_by_taxonomy($postId, 'project-category'); } if ($query->have_posts()) { ?> <aside class="related"> <aside class="styled_header style2"><h6><?php _e('Related Works', THB_THEME_NAME); ?> </h6></aside> <div class="row relatedposts hide-on-print"> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class="small-4 columns"> <article <?php post_class('post cf show-titles'); ?> id="post-<?php the_ID();
?> </p> <!--END .sidebar --> </div> <!--BEGIN .recent-wrap --> <div class="recent-wrap"> <?php //Set the starter count $start = 3; //Set the finish count $finish = 1; $postId = get_the_ID(); $related = get_posts_related_by_taxonomy($postId, 'skill-type', get_the_ID()); //Get the total amount of posts $post_count = $related->post_count; while ($related->have_posts()) { $related->the_post(); ?> <?php if (is_multiple($start, 3)) { /* if the start count is a multiple of 3 */ ?> <!--BEGIN .hentry-wrap --> <div id="recent-portfolio-detail" class="hentry-wrap clearfix"> <?php } ?>