/** * Displays navigation to next/previous post when applicable. * * @since Twenty Thirteen 1.0 * * @return void */ function activetheme_post_nav() { global $post; // Don't print empty markup if there's nowhere to navigate. $previous = is_attachment() ? get_post($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"> <?php /* <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'activetheme' ); ?></h1> */ ?> <div class="nav-links clearfix"> <?php if (is_singular('article')) { previous_post_link('%link', _x('<span class="meta-nav meta-nav-prev">←</span> Previous Article', 'Previous article link', 'activetheme')); next_post_link('%link', _x('Next Article <span class="meta-nav meta-nav-next">→</span>', 'Next article link', 'activetheme')); } else { previous_post_link('%link', _x('<span class="meta-nav meta-nav-prev">←</span> Previous Post', 'Previous post link', 'activetheme')); next_post_link('%link', _x('Next Post <span class="meta-nav meta-nav-next">→</span>', 'Next post link', 'activetheme')); } ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous post when applicable. * * @since DSW oddil 1.0 */ function dswoddil_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', 'dswoddil'); ?> </h1> <div class="nav-links"> <?php if (is_attachment()) { previous_post_link('%link', __('<span class="meta-nav">Published In</span>%title', 'dswoddil')); } else { previous_post_link('%link', __('<span class="meta-nav">Previous Post</span>%title', 'dswoddil')); next_post_link('%link', __('<span class="meta-nav">Next Post</span>%title', 'dswoddil')); } ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
function sf_display_nav($navstyle = "nextprev", $class = "navigation") { if (is_single()) { echo '<div class="' . $class . '"> <!-- BEGIN .' . $class . ' -->'; echo '<div class="left">'; previous_post_link(); echo '</div>'; echo '<div class="right">'; next_post_link(); echo '</div>'; echo '</div> <!-- END .' . $class . ' -->'; } else { $_SERVER['REQUEST_URI'] = preg_replace("/(.*?).php(.*?)&(.*?)&(.*?)&_=/", "\$2\$3", $_SERVER['REQUEST_URI']); echo '<div class="' . $class . '"> <!-- BEGIN .' . $class . ' -->'; if ($navstyle == "nextprev") { echo '<div class="left">'; next_posts_link('« Older Entries'); echo '</div>'; echo '<div class="right">'; previous_posts_link('Newer Entries »'); echo '</div>'; } elseif ($navstyle == "numbar") { sf_corenav(); } echo '</div> <!-- END .' . $class . ' -->'; } }
/** * Display navigation to next/previous post when applicable. * * @return void */ function my_simone_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"> <div class="post-nav-box clear"> <h1 class="screen-reader-text"><?php _e('Post navigation', 'my-simone'); ?> </h1> <div class="nav-links"> <?php previous_post_link('<div class="nav-previous"><div class="nav-indicator">' . _x('Previous Post:', 'Previous post', 'my-simone') . '</div><h1>%link</h1></div>', '%title'); next_post_link('<div class="nav-next"><div class="nav-indicator">' . _x('Next Post:', 'Next post', 'my-simone') . '</div><h1>%link</h1></div>', '%title'); ?> </div><!-- .nav-links --> </div><!-- .post-nav-box --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous post when applicable. * * @todo Remove this function when WordPress 4.3 is released. */ function wpsp_the_post_navigation() { // 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); /*$post_category_ids = wp_get_post_categories( get_the_ID(), array('fields' => 'ids') ); $category_ids = array(); foreach ( $post_category_ids as $cat ) { $category = get_category( $cat ); array_push( $category_ids, $category->category_parent ); } print_r( $category_ids );*/ if (!$next && !$previous) { return; } ?> <nav class="navigation post-navigation" role="navigation"> <div class="post-nav-box clearfix"> <h1 class="screen-reader-text"><?php _e('Post navigation', 'klahan9'); ?> </h1> <div class="nav-links"> <?php previous_post_link('<div class="nav-previous"><div class="nav-indicator">' . _x('Previous Post:', 'Previous post', 'klahan9') . '</div><h1>%link</h1></div>', '%title', true); next_post_link('<div class="nav-next"><div class="nav-indicator">' . _x('Next Post:', 'Next post', 'klahan9') . '</div><h1>%link</h1></div>', '%title', true); ?> </div><!-- .nav-links --> </div><!-- .post-nav-box --> </nav><!-- .navigation --> <?php }
/** * Displays navigation to next/previous post when applicable. * * @since Twenty Thirteen 1.0 * * @return void */ function twentythirteen_post_nav() { global $post; // Don't print empty markup if there's nowhere to navigate. $previous = is_attachment() ? get_post($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', 'twentythirteen'); ?> </h1> <div class="nav-links"> <?php /* if ( ! next_post_link('%link') ) { echo "Test!"; } */ previous_post_link('%link', _x('<span class="meta-nav">←</span> %title', 'Previous post link', 'twentythirteen'), $in_same_cat = true); ?> <?php next_post_link('%link', _x('%title <span class="meta-nav">→</span>', 'Next post link', 'twentythirteen'), $in_same_cat = true); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous post when applicable. * * @since Twenty Fourteen 1.0 * * @return void */ function panopta2014_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; } ?> <div class="row"> <div class="col-xs-12 col-sm-11 col-sm-offset-1"> <nav class="navigation post-navigation" role="navigation"> <div class="nav-links row"> <?php if (is_attachment()) { previous_post_link('%link', __('<div class="col-xs-12"><span class="meta-nav">Published In</span>%title</div>', 'twentyfourteen')); } else { previous_post_link('<div class="col-xs-12 col-sm-6">%link</div>', __('<i class="fa fa-angle-left"></i> <span class="meta-nav">Previous: </span>%title', 'twentyfourteen')); next_post_link('<div class="col-xs-12 col-sm-6">%link</div>', __('<span class="meta-nav">Next: </span>%title <i class="fa fa-angle-right"></i>', 'twentyfourteen')); } ?> </div><!-- .nav-links --> </nav><!-- .navigation --> </div> </div> <?php }
/** * Display navigation to next/previous post when applicable. * * @todo Remove this function when WordPress 4.3 is released. */ function the_post_navigation() { // 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 col-xs-12" role="navigation"> <h2 class="screen-reader-text"><?php _e('Post navigation', 'flat-sassy-boots'); ?> </h2> <div class="nav-links"> <?php //previous_post_link( '<div class="nav-previous"><div class="nav-indicator">' . _x( 'Previous Post:', 'Previous post', 'flat-sassy-boots' ) . '</div><h1>%link</h1><i class="fa fa-arrow-left"></i></div>', '%title' ); //next_post_link( '<div class="nav-next"><div class="nav-indicator">' . _x( 'Next Post:', 'Next post', 'flat-sassy-boots' ) . '</div><h1>%link</h1><i class="fa fa-arrow-right"></i></div>', '%title' ); previous_post_link('<div class="nav-previous"><strong>%link</strong></div>', '%title'); next_post_link('<div class="nav-next"><strong>%link</strong></div>', '%title'); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous pages when applicable */ function orbit_content_nav($nav_id) { global $wp_query; ?> <nav id="<?php echo $nav_id; ?> "> <ul> <?php if (is_single()) { // navigation links for single posts ?> <li><?php previous_post_link('%link', '' . _x('←', 'Previous post link', 'orbit') . '%title'); ?> </li> <li><?php next_post_link('%link', '%title' . _x('→', 'Next post link', 'orbit') . ''); ?> </li> <?php } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) { // navigation links for home, archive, and search pages ?> <?php if (get_next_posts_link()) { ?> <li><?php next_posts_link(__('← Older posts', 'orbit')); ?> </li> <?php } ?> <?php if (get_previous_posts_link()) { ?> <li><?php previous_posts_link(__('Newer posts →', 'orbit')); ?> </li> <?php } ?> <?php } ?> </ul> </nav><!-- #<?php echo $nav_id; ?> --> <?php }
/** * Display navigation to next/previous post when applicable. * * @return void */ function apostrophe_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 esc_html_e('Post navigation', 'apostrophe'); ?> </h1> <div class="nav-links"> <div class="nav-previous"> <?php previous_post_link('%link', '<span class="meta-nav">' . _x('Previous', 'Previous post link', 'apostrophe') . '</span> <span class="apostrophe-post-title">%title</span>'); ?> </div> <div class="nav-next"> <?php next_post_link('%link', '<span class="meta-nav">' . _x('Next', 'Next post link', 'apostrophe') . '</span> <span class="apostrophe-post-title">%title</span>'); ?> </div> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
function sbg_custom_post_nav() { echo '<div class="prev-next-post-links">'; previous_post_link('<div class="previous-post-link">« %link</div>', '<strong>%title</strong>'); next_post_link('<div class="next-post-link">%link »</div>', '<strong>%title</strong>'); echo '</div>'; }
/** * Display navigation to next/previous post when applicable. * * @return void */ function writ_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', 'writ'); ?> </h1> <div class="nav-links"> <?php previous_post_link('<div class="nav-previous">%link</div>', '<div class="arrow">' . _x('←', 'Previous post link', 'writ') . '</div><div class="link">%title</div>'); ?> <?php next_post_link('<div class="nav-next">%link</div>', '<div class="arrow">' . _x('→', 'Next post link', 'writ') . '</div><div class="link">%title</div>'); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous post when applicable. * * @return void */ function homeword_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="assistive-text"><?php _e('Post navigation', 'homeword'); ?> </h1> <div class="nav-links"> <?php previous_post_link('%link', _x('<span class="meta-nav">←</span> %title', 'Previous post link', 'homeword')); ?> <?php next_post_link('%link', _x('%title <span class="meta-nav">→</span>', 'Next post link', 'homeword')); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
function prev_next_post_link() { $prev_post = get_previous_post(); $next_post = get_next_post(); ?> <div id="post_nav"> <?php if ($prev_post) { ?> <div id="prev_post"> <?php previous_post_link('%link', '⇐%title', false); ?> </div> <?php } ?> <?php if ($next_post) { ?> <div id="next_post"> <?php next_post_link('%link', '%title⇒', false); ?> </div> <?php } ?> </div> <?php }
/** * Display navigation to next/previous post when applicable. * * @deprecated 2.1 Use the_post_navigation() */ function blue_planet_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 esc_html_e('Post navigation', 'blue-planet'); ?> </h1> <div class="nav-links"> <?php previous_post_link('%link', '<span class="meta-nav">←</span> %title'); ?> <?php next_post_link('%link', '%title <span class="meta-nav">→</span>'); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous post when applicable. */ function zerif_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"> <h2 class="screen-reader-text"><?php _e('Post navigation', 'zerif-lite'); ?> </h2> <div class="nav-links"> <?php previous_post_link('<div class="nav-previous">%link</div>', _x('<span class="meta-nav">←</span> %title', 'Previous post link', 'zerif-lite')); next_post_link('<div class="nav-next">%link</div>', _x('%title <span class="meta-nav">→</span>', 'Next post link', 'zerif-lite')); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous post when applicable. * * @since Twenty Fifteen 1.0 */ function twentyfifteen_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 || is_attachment() && 'attachment' == $previous->post_type) { return; } $prev_class = $next_class = ''; if ($previous && has_post_thumbnail($previous->ID)) { $prev_class = " has-post-thumbnail"; } if ($next && has_post_thumbnail($next->ID)) { $next_class = " has-post-thumbnail"; } ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php esc_html_e('Post navigation', 'twentyfifteen'); ?> </h1> <div class="nav-links"> <?php if (is_attachment()) { previous_post_link('<div class="nav-previous' . $prev_class . '">%link</div>', _x('<span class="meta-nav">Published In</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen')); } else { previous_post_link('<div class="nav-previous' . $prev_class . '">%link</div>', _x('<span class="meta-nav">Previous</span><span class="post-title">%title</span>', 'Previous post link', 'twentyfifteen')); next_post_link('<div class="nav-next' . $next_class . '">%link</div>', _x('<span class="meta-nav">Next</span><span class="post-title">%title</span>', 'Next post link', 'twentyfifteen')); } ?> </div><!-- .nav-links --> </nav><!-- .post-navigation --> <?php }
function flat_post_nav() { global $post; $previous = is_attachment() ? get_post($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', 'flat'); ?> </h1> <div class="nav-links"> <?php previous_post_link('%link', _x('<span class="meta-nav">←</span> %title', 'Previous post link', 'flat')); ?> <?php next_post_link('%link', _x('%title <span class="meta-nav">→</span>', 'Next post link', 'flat')); ?> </div> </nav> <?php }
/** * Display navigation to next/previous post when applicable. * * @todo Remove this function when WordPress 4.3 is released. */ function the_post_navigation() { // 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"> <h2 class="screen-reader-text"><?php _e('Post navigation', 'ncssm_sg'); ?> </h2> <div class="nav-links"> <?php previous_post_link('<div class="nav-previous">%link</div>', '%title'); next_post_link('<div class="nav-next">%link</div>', '%title'); ?> </div> <!-- .nav-links --> </nav><!-- .navigation --> <?php }
/** * Display navigation to next/previous pages when applicable * * @since Sunspot 1.0 */ function sunspot_content_nav( $nav_id ) { global $wp_query; $nav_class = 'site-navigation paging-navigation'; if ( is_single() ) $nav_class = 'site-navigation post-navigation'; ?> <nav role="navigation" id="<?php echo $nav_id; ?>" class="<?php echo $nav_class; ?>"> <h1 class="assistive-text"><?php _e( 'Post navigation', 'sunspot' ); ?></h1> <?php if ( is_single() ) : // navigation links for single posts ?> <?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'sunspot' ) . '</span> %title' ); ?> <?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'sunspot' ) . '</span>' ); ?> <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?> <?php if ( get_next_posts_link() ) : ?> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'sunspot' ) ); ?></div> <?php endif; ?> <?php if ( get_previous_posts_link() ) : ?> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'sunspot' ) ); ?></div> <?php endif; ?> <?php endif; ?> </nav><!-- #<?php echo $nav_id; ?> --> <?php }
function wpex_post_meta() { global $post; $post_id = $post->ID; $category = get_the_category(); $fist_category = $category[0]; ob_start(); ?> <ul class="meta clr"> <li class="meta-date"><span class="fa fa-clock-o"></span><?php echo get_the_date(); ?> </li> <?php if ($fist_category) { ?> <li class="meta-category"><span class="fa fa-folder-o"></span><a href="<?php echo get_category_link($category[0]->term_id); ?> " title="<?php echo $category[0]->cat_name; ?> "><?php echo $category[0]->cat_name; ?> </a></li> <?php } ?> <?php if (comments_open()) { ?> <li class="meta-comments comment-scroll"><span class="fa fa-comment-o"></span><?php comments_popup_link(__('0 Comments', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link'); ?> </li> <?php } ?> <?php if (is_singular('post') && wpex_option('post_next_prev_meta', '1') == '1') { ?> <li id="single-post-next-prev" class="clr"> <?php next_post_link('%link', '<span class="theme-button"><span class="fa fa-chevron-left"></span></span>'); ?> <?php previous_post_link('%link', '<span class="theme-button"><span class="fa fa-chevron-right"></span></span>'); ?> </li><!-- #single-post-next-prev --> <?php } ?> </ul> <?php echo ob_get_clean(); }
function section_template() { ?> <?php pagelines_register_hook( 'pagelines_section_before_postnav' ); // Hook ?> <div class="post-nav fix"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span> </div> <?php pagelines_register_hook( 'pagelines_section_after_postnav' ); // Hook ?> <?php }
function pgsa_prev_next_post_nav() { if ('photo-gallery' == get_post_type()) { echo '<div class="wrap"><div class="prev-next-navigation">'; previous_post_link('<div class="previous">%link</div>', '<i class="fa fa-chevron-circle-left"></i> %title', TRUE, ' ', 'procedures'); next_post_link('<div class="next">%link</div>', '%title <i class="fa fa-chevron-circle-right"></i>', TRUE, ' ', 'procedures'); echo '</div></div>'; } }
function hepouf_content_nav($nav_id) { global $wp_query, $post; // Don't print empty markup on single pages if there's nowhere to navigate. if (is_single()) { $previous = is_attachment() ? get_post($post->post_parent) : get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if (!$next && !$previous) { return; } } // Don't print empty markup in archives if there's only one page. if ($wp_query->max_num_pages < 2 && (is_home() || is_archive() || is_search())) { return; } $nav_class = is_single() ? 'post-navigation' : 'paging-navigation'; ?> <nav role="navigation" id="<?php echo esc_attr($nav_id); ?> " class="<?php echo $nav_class; ?> "> <?php if (is_single()) { // navigation links for single posts ?> <?php previous_post_link('<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x('<i class="ico-left-open"></i>', 'Previous post link', 'athemes') . '</span> %title'); ?> <?php next_post_link('<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x('<i class="ico-right-open"></i>', 'Next post link', 'athemes') . '</span>'); ?> <?php } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) { // navigation links for home, archive, and search pages ?> <?php wp_pagenavi(); ?> <?php } ?> </nav><!-- #<?php echo esc_html($nav_id); ?> --> <?php }
function greybox_next_post_link() { $gb_npl = get_next_post_link(); if (empty($gb_npl)) { echo '<p>You are reading the newest post.</p>'; } else { echo '<p>Read a newer post:</p>'; next_post_link(); } }
function render_content() { ?> <?php if (have_posts()) { ?> <div class="loop"> <div class="loop-content"> <?php while (have_posts()) { // The Loop ?> <?php the_post(); ?> <?php get_template_part('post-formats/content-single', get_post_format()); ?> <!-- end .post --> <div class="loop-footer"> <!-- Previous/Next page navigation --> <div class="loop-utility clearfix"> <div class="alignleft"><?php next_post_link('%link', __('← Next Post', 'it-l10n-Builder-Paige'), FALSE); ?> </div> <div class="alignright"><?php previous_post_link('%link', __('Previous Post →', 'it-l10n-Builder-Paige'), FALSE); ?> </div> </div> </div> <?php comments_template(); // include comments template ?> <?php } // end of one post ?> </div> </div> <?php } else { // do not delete ?> <?php do_action('builder_template_show_not_found'); ?> <?php } // do not delete }
function centilium_next_prev_post() { ?> <div class="next_prev_post"> <?php previous_post_link('<div class="nav-previous"> %link</div>', '<i class="fa fa-chevron-left"></i>' . __('Previous Post', 'centilium')); next_post_link('<div class="nav-next">%link</div>', __('Next Post', 'centilium') . '<i class="fa fa-chevron-right"></i>'); ?> </div><!-- .next_prev_post --> <?php }
/** * Display navigation to next/previous pages when applicable */ function omega_content_nav() { global $wp_query, $post; // Don't print empty markup on single pages if there's nowhere to navigate. if (is_single()) { $previous = is_attachment() ? get_post($post->post_parent) : get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if (!$next && !$previous) { return; } } if (is_singular() && !get_theme_mod('single_nav', 0)) { return; } // Don't print empty markup in archives if there's only one page. if ($wp_query->max_num_pages < 2 && (is_home() || is_archive() || is_search())) { return; } $nav_class = is_single() ? 'post-navigation' : 'paging-navigation'; ?> <nav role="navigation" id="nav-below" class="navigation <?php echo $nav_class; ?> "> <?php if (is_single() && get_theme_mod('single_nav', 0)) { // navigation links for single posts ?> <?php previous_post_link('<div class="nav-previous alignleft">%link</div>', '<span class="meta-nav">' . _x('←', 'Previous post link', 'omega') . '</span> %title'); ?> <?php next_post_link('<div class="nav-next alignright">%link</div>', '%title <span class="meta-nav">' . _x('→', 'Next post link', 'omega') . '</span>'); ?> <?php } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) { // navigation links for home, archive, and search pages ?> <?php loop_pagination(); ?> <?php } ?> </nav><!-- #nav-below --> <?php }
function bfa_next_previous_post_links($location = "Top") { global $bfa_ata; if (is_single() and strpos($bfa_ata['location_single_next_prev'], $location) !== FALSE and intval(get_query_var('email')) != 1) { echo '<div class="navigation-' . strtolower($location) . '"> <div class="older' . ($bfa_ata['home_single_next_prev'] != '' ? '-home' : '') . '">'; $bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ? previous_post_link($bfa_ata['single_next_prev_older']) : next_post_link($bfa_ata['single_next_prev_newer']); echo ' </div>' . ($bfa_ata['home_single_next_prev'] != '' ? '<div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' . $bfa_ata['home_single_next_prev'] . '</a></div>' : '') . '<div class="newer' . ($bfa_ata['home_single_next_prev'] != '' ? '-home' : '') . '"> '; $bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ? next_post_link($bfa_ata['single_next_prev_newer']) : previous_post_link($bfa_ata['single_next_prev_older']); echo '</div><div class="clearboth"></div></div>'; } }
function emphasize_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"> <h3 class="screen-reader-text"><?php esc_html_e('Post navigation', 'emphasize'); ?> </h3> <div class="nav-links"> <?php previous_post_link(esc_html_x('Previous Article: %link', '', 'emphasize'), '%title'); ?> <br/> <?php next_post_link(esc_html_x('Next Article: %link', '', 'emphasize'), '%title'); ?> </div> </nav> <?php }