本文整理汇总了PHP中the_posts_navigation函数的典型用法代码示例。如果您正苦于以下问题:PHP the_posts_navigation函数的具体用法?PHP the_posts_navigation怎么用?PHP the_posts_navigation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_posts_navigation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lightseek_posts_navigation
function lightseek_posts_navigation()
{
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else {
the_posts_navigation();
}
}
示例2: utility_pro_post_pagination
/**
* Use WordPress archive pagination.
*
* Return a paginated navigation to next/previous set of posts, when
* applicable. Includes screen reader text for better accessibility.
*
* @since 1.0.0
*
* @see the_posts_pagination()
* @return string Markup for pagination links.
*/
function utility_pro_post_pagination()
{
$args = array('mid_size' => 2, 'before_page_number' => '<span class="screen-reader-text">' . __('Page', 'utility-pro') . ' </span>');
if ('numeric' === genesis_get_option('posts_nav')) {
the_posts_pagination($args);
} else {
the_posts_navigation($args);
}
}
示例3: onePage
/**
* @package ease
* @subpackage module-onepage
*/
function onePage()
{
$the_query = new WP_Query(array('post_type' => 'page', 'orderby' => 'menu_order', 'order' => 'ASC'));
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
$content .= "<article id=\"section_" . the_title() . "\">";
$content .= "<div class=\"entry-content\">";
$content .= the_content();
$content .= "</div></article>";
$content .= the_posts_navigation();
}
}
return $content;
}
示例4: mdc_posts_navigation
function mdc_posts_navigation()
{
?>
<div class="posts-navigation-wrap">
<div class="container">
<?php
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else {
the_posts_navigation();
}
?>
</div>
</div>
<?php
}
示例5: magzimum_custom_posts_navigation
/**
* Posts navigation
*
* @since Magzimum 1.0
*
*/
function magzimum_custom_posts_navigation()
{
$pagination_type = magzimum_get_option('pagination_type');
switch ($pagination_type) {
case 'default':
the_posts_navigation();
break;
case 'numeric':
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else {
the_posts_navigation();
}
break;
default:
break;
}
}
示例6: simple_life_paging_nav
/**
* Display navigation to next/previous set of posts when applicable.
*/
function simple_life_paging_nav()
{
// Don't print empty markup if there's only one page.
if ($GLOBALS['wp_query']->max_num_pages < 2) {
return;
}
$pagination_type = esc_attr(simple_life_get_option('pagination_type'));
switch ($pagination_type) {
case 'numeric':
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} else {
the_posts_pagination(array('mid_size' => 2, 'prev_text' => '<span class="meta-nav"><i class="fa fa-chevron-left" aria-hidden="true"></i></span> ' . __('Previous page', 'simple-life'), 'next_text' => __('Next page', 'simple-life') . ' <span class="meta-nav"><i class="fa fa-chevron-right" aria-hidden="true"></i></span>', 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'simple-life') . ' </span>'));
}
break;
case 'default':
the_posts_navigation(array('prev_text' => '<span class="meta-nav"><i class="fa fa-chevron-left" aria-hidden="true"></i></span> ' . __('Older posts', 'simple-life'), 'next_text' => __('Newer posts', 'simple-life') . ' <span class="meta-nav"><i class="fa fa-chevron-right" aria-hidden="true"></i></span>'));
break;
default:
break;
}
}
示例7: while
?>
<?php
while (have_posts()) {
the_post();
?>
<?php
get_template_part('template-parts/content');
?>
<?php
}
?>
<?php
the_posts_navigation(array('prev_text' => 'Older Posts →', 'next_text' => '← Newer Posts'));
?>
<?php
} else {
?>
<?php
get_template_part('template-parts/content', 'none');
?>
<?php
}
?>
</div><!-- #primary -->
示例8: printf
<div class="container">
<h1 class="page-title"><?php
printf(esc_html__('Search Results for: %s', 'kanec'), '<span>' . get_search_query() . '</span>');
?>
</h1>
</div>
</header><!-- .page-header -->
<?php
/* Start the Loop */
while (have_posts()) {
the_post();
/**
* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called content-search.php and that will be used instead.
*/
get_template_part('template-parts/content', 'search');
}
the_posts_navigation(['prev_text' => '<i class="icon icon-arrow-left"></i> Older posts', 'next_text' => 'Newer posts <i class="icon icon-arrow-right"></i>']);
} else {
get_template_part('template-parts/content', 'none');
}
?>
</main><!-- #main -->
</section><!-- #primary -->
<?php
get_sidebar();
get_footer();
示例9: get_template_part
<?php
/**
* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called content-search.php and that will be used instead.
*/
get_template_part('template-parts/content', 'search');
?>
<?php
}
?>
<?php
the_posts_navigation(array('prev_text' => '<span class="material_design_par_amauri_navigate">❰</span> ' . __('Older posts', 'material-design-par-amauri'), 'next_text' => __('Newer posts', 'material-design-par-amauri') . ' <span class="material_design_par_amauri_navigate">❱</span>'));
?>
<?php
} else {
?>
<?php
get_template_part('template-parts/content', 'none');
?>
<?php
}
?>
</main><!-- #main -->
示例10: locate_template
?>
<div class="post-list">
<?php
if ($post->post_type == 'post') {
?>
<?php
$time_class = 'time-big';
include locate_template('templates/post-time.php');
?>
<?php
}
?>
<?php
include locate_template('templates/post-list-article.php');
?>
</div>
<?php
}
?>
<div class="pagination">
<?php
$args = ['prev_text' => '<svg class="prev-page icon-arrow-right" role="img"><use xlink:href="#icon-arrow-right"></use></svg>', 'next_text' => '<svg class="next-page icon-arrow-left" role="img"><use xlink:href="#icon-arrow-left"></use></svg>'];
the_posts_navigation($args);
?>
<?php
include locate_template('templates/pagination.php');
?>
</div>
示例11: while
?>
<?php
while (have_posts()) {
the_post();
?>
<?php
get_template_part('content', 'search');
?>
<?php
}
?>
<?php
the_posts_navigation(array('prev_text' => '<span class="meta-nav">←</span> ' . __('Older posts', 'blue-planet'), 'next_text' => __('Newer posts', 'blue-planet') . ' <span class="meta-nav">→</span>', 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Posts navigation', 'blue-planet') . ' </span>'));
?>
<?php
} else {
?>
<?php
get_template_part('content', 'none');
?>
<?php
}
?>
</main><!-- #main -->
示例12: get_template_part
<?php
/**
* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called content-search.php and that will be used instead.
*/
get_template_part('content', 'search');
?>
<?php
}
?>
<?php
the_posts_navigation(array('prev_text' => __('Previous page', 'aaron'), 'next_text' => __('Next page', 'aaron')));
?>
<?php
/* If the search is not visible in the menu, and there is only one page of search results, display a search form on the search page. */
if ($GLOBALS['wp_query']->max_num_pages < 2 && get_theme_mod('aaron_hide_search') != "") {
echo '<span class="screen-reader-text">' . esc_html__('Would you like to search again?', 'aaron') . '</span><br/>';
get_search_form();
}
?>
<?php
} else {
?>
示例13: if
</div>
</div>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php the_posts_navigation(); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
示例14: while
</header>
<?php
}
?>
<?php
// Start the loop.
while (have_posts()) {
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part('content', get_post_format());
// End the loop.
}
// Previous/next page navigation.
the_posts_navigation(array('next_text' => '<span class="meta-nav" aria-hidden="true">' . __('Next page:', 'onepixel') . '</span> ' . '<span class="screen-reader-text">' . __('Next page', 'onepixel') . '</span> ' . '<span class="post-title">%title</span>', 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __('Previous page:', 'onepixel') . '</span> ' . '<span class="screen-reader-text">' . __('Previous page', 'onepixel') . '</span> ' . '<span class="post-title">%title</span>'));
the_posts_pagination(array('prev_text' => __('Previous page', 'onepixel'), 'next_text' => __('Next page', 'onepixel'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'onepixel') . ' </span>'));
// If no content, include the "No posts found" template.
} else {
get_template_part('content', 'none');
}
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php
get_footer();
示例15: while
<?php
while (have_posts()) {
the_post();
?>
<?php
get_template_part('template-parts/content', get_post_format());
?>
<?php
if (!post_password_required() && (comments_open() || get_comments_number())) {
comments_template();
}
the_posts_navigation(array('next_text' => '← %title', 'prev_text' => '%title →'));
?>
<?php
}
?>
</div>
<div class="col-md-3">
<?php
get_sidebar();
?>
</div>
</div>