function swell_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = is_attachment() ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if (!$next && !$previous) { return; } ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e('Post navigation', 'swell'); ?> </h1> <div class="nav-links"> <?php next_post_link('<div class="nav-next">%link</div>', _x('<span class="meta-nav">←</span> %title', 'Next post link', 'swell')); $portfolio_page_id = swell_get_portfolio_id(); if ($portfolio_page_id) { ?> <div class="nav-portfolio <?php if (!get_next_post()) { echo 'inactive'; } ?> "> <a href="<?php echo esc_url(get_permalink($portfolio_page_id)); ?> "></a> </div> <?php } previous_post_link('<div class="nav-previous">%link</div>', _x('%title <span class="meta-nav">→</span>', 'Previous post link', 'swell')); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
?> <div class="thumbs clearfix"> <?php while ($projects->have_posts()) { $projects->the_post(); ?> <?php get_template_part('content-project-thumb'); ?> <?php } ?> </div> <?php $portfolio_page_id = swell_get_portfolio_id(); ?> <?php if ($portfolio_page_id) { ?> <div class="view-all"> <a href="<?php echo esc_url(get_permalink($portfolio_page_id)); ?> " class="button"><?php _e('View All', 'port'); ?> </a> </div> <?php }