本文整理汇总了PHP中get_the_post_navigation函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_post_navigation函数的具体用法?PHP get_the_post_navigation怎么用?PHP get_the_post_navigation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_the_post_navigation函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootswatch_post_navigation
/**
* 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.
}
示例2: lightseek_post_navigation
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;
}
示例3: the_post_navigation
/**
* 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);
}
示例4: the_title
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
示例5: some_like_it_neat_post_navigation
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>'));
}
}
示例6: get_template_part
<?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();
?>
示例7: sazerac_post_navigation
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>'));
}
}
示例8: the_post_navigation
/**
* 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));
}
示例9: the_widget
<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();
示例10: checkout_post_navs
/**
* 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);
}