/** * Prints previous and next posts links. */ function bootswatch_post_navigation() { $replacements = ['<div class="nav-links">' => '<ul class="nav-links pager">', '<div class="nav-previous">' => '<li class="nav-previous previous">', '<div class="nav-next">' => '<li class="nav-next next">', '</a></div>' => '</a></li>', 'rel="prev">' => 'rel="prev">« ', '</a></li></div>' => ' »</a></li></ul>']; $replacements = apply_filters('bootswatch_post_navigation_replacements', $replacements); echo str_replace(array_keys($replacements), array_values($replacements), get_the_post_navigation()); // WPCS XSS OK. }
function lightseek_post_navigation($args = array('prev_text' => '<span class="fa fa-caret-left" aria-hidden="true"></span> %title', 'next_text' => '%title <span class="fa fa-caret-right" aria-hidden="true"></span>')) { $out = get_the_post_navigation($args); $out = str_replace("<div class=\"nav-links\">", "<ul class=\"nav-links pager\">", $out); $out = str_replace("</div></div>", "</div></ul>", $out); $out = str_replace("<div class=\"nav-next\">", " <li class='nav-next pager-next' title='Next Post'>", $out); $out = str_replace("<div class=\"nav-previous\">", " <li class='nav-previous pager-prev' title='Previous Post'>", $out); $out = str_replace("</div>", "", $out); echo $out; }
/** * Display navigation to next/previous post when applicable. * * @since 4.1.0 * * @param array $args Optional. See {@see get_the_post_navigation()} for available * arguments. Default empty array. */ function the_post_navigation($args = array()) { echo get_the_post_navigation($args); }
the_title(); ?> </h1> </header><!-- .entry-header --> <div class="entry-content" itemprop="mainContentOfPage"> <?php the_content(); ?> <?php if (function_exists('get_the_post_navigation')) { echo get_the_post_navigation(array('prev_text' => __('← Previous Page', 'bs'), 'next_text' => __('Next Page →', 'bs'), 'screen_reader_text' => __('Page navigation', 'bs'))); } else { wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'bs'), 'after' => '</div>')); } ?> </div><!-- .entry-content --> <?php edit_post_link(__('Edit', 'bs'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> <?php tha_entry_bottom(); ?> </article><!-- #post-## --> <?php
function some_like_it_neat_post_navigation() { if (function_exists('get_the_post_navigation') && is_singular() && !is_page_template('page-templates/template-landing-page.php')) { echo get_the_post_navigation(array('prev_text' => __('← %title', 'some-like-it-neat'), 'next_text' => __('%title →', 'some-like-it-neat'), 'screen_reader_text' => __('Page navigation', 'some-like-it-neat'))); } else { wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'some-like-it-neat'), 'after' => '</div>')); } }
<?php get_template_part('loop-hoge'); ?> <?php } else { ?> <?php get_template_part('loop'); ?> <?php } ?> <?php // post_navigation $nav = get_the_post_navigation(array('in_same_term' => 'true', 'prev_text' => '前の記事 : %title', 'next_text' => '次の記事 : %title')); echo '<div class="container">'; echo $nav; echo '</div>'; ?> <?php comments_template(); ?> </div><!-- main-contant end --> <?php get_sidebar(); ?>
function sazerac_post_navigation() { if (function_exists('get_the_post_navigation') && is_singular()) { echo get_the_post_navigation(array('prev_text' => __('← %title', 'sazerac'), 'next_text' => __('%title →', 'sazerac'), 'screen_reader_text' => __('Page navigation', 'sazerac'))); } else { wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'sazerac'), 'after' => '</div>')); } }
/** * Display navigation to next/previous post when applicable. * * @todo Remove this function when WordPress 4.3 is released. * * @param array $args Optional. See {@see get_the_post_navigation()} for available * arguments. Default empty array. */ function the_post_navigation($args = array()) { echo balanceTags(get_the_post_navigation($args)); }
<div class="column-side-content" style="display: block;"> <div class="sidebar-widget"> <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('widget-area-1')) { } ?> </div> <div class="sidebar-widget"> <?php the_widget('WP_Widget_Recent_Posts', array(), array('before_title' => '<h3>', 'after_title' => '</h3>')); ?> </div> <div class="sidebar-widget"> <article class="widget"> <?php echo get_the_post_navigation(array('next_text' => '<span class="meta-nav" aria-hidden="true">' . __('Next', 'woopstrapblank') . '</span> ' . '<span class="screen-reader-text">' . __('Next post:', 'woopstrapblank') . '</span> ' . '<span class="post-title">%title</span>', 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __('Previous', 'woopstrapblank') . '</span> ' . '<span class="screen-reader-text">' . __('Previous post:', 'woopstrapblank') . '</span> ' . '<span class="post-title">%title</span>', 'screen_reader_text' => __('Post navigation', 'woopstrapblank'))); ?> </article> </div> </div> <!-- /column-side-content --> </div> <!-- /row --> </div> <!-- /container --> </div> <!-- /section --> <?php get_footer();
/** * Displays next/previous post navigations * * @since checkout 1.0 */ function checkout_post_navs() { $nav_args = array('prev_text' => '<div class="nav-text"><span>' . __('Previous', 'checkout') . ' <i class="fa fa-angle-right"></i></span> <h4>%title</h4></div>', 'next_text' => '<div class="nav-text"><span><i class="fa fa-angle-left"></i> ' . __('Next', 'checkout') . '</span> <h4>%title</h4></div>', 'screen_reader_text' => __('Post navigation', 'checkout')); echo get_the_post_navigation($nav_args); }