• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP the_posts_navigation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中the_posts_navigation函数的典型用法代码示例。如果您正苦于以下问题:PHP the_posts_navigation函数的具体用法?PHP the_posts_navigation怎么用?PHP the_posts_navigation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了the_posts_navigation函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: lightseek_posts_navigation

function lightseek_posts_navigation()
{
    if (function_exists('wp_pagenavi')) {
        wp_pagenavi();
    } else {
        the_posts_navigation();
    }
}
开发者ID:amielucha,项目名称:lightseek,代码行数:8,代码来源:template-tags.php


示例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);
    }
}
开发者ID:ashenkar,项目名称:sanga,代码行数:20,代码来源:theme-config.php


示例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;
}
开发者ID:TheCodePianist,项目名称:ease,代码行数:19,代码来源:~module.onepage.php


示例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 
}
开发者ID:jojoee,项目名称:medium-clone,代码行数:16,代码来源:functions.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;
     }
 }
开发者ID:robertmeans,项目名称:fosterfamilydental,代码行数:24,代码来源:pagination.php


示例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;
     }
 }
开发者ID:ernilambar,项目名称:simple-life,代码行数:25,代码来源:template-tags.php


示例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 &rarr;', 'next_text' => '&larr; Newer Posts'));
    ?>

		<?php 
} else {
    ?>

			<?php 
    get_template_part('template-parts/content', 'none');
    ?>

		<?php 
}
?>

		</div><!-- #primary -->
开发者ID:katrinagd,项目名称:p5-custom-wordpress-theme,代码行数:31,代码来源:index.php


示例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();
开发者ID:vonkanehoffen,项目名称:kanec-wp-theme,代码行数:31,代码来源:search.php


示例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">&#x2770;</span> ' . __('Older posts', 'material-design-par-amauri'), 'next_text' => __('Newer posts', 'material-design-par-amauri') . ' <span class="material_design_par_amauri_navigate">&#x2771;</span>'));
    ?>

		<?php 
} else {
    ?>

			<?php 
    get_template_part('template-parts/content', 'none');
    ?>

		<?php 
}
?>

		</main><!-- #main -->
开发者ID:henlz,项目名称:WCode-WebSite,代码行数:30,代码来源:search.php


示例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>
开发者ID:firebelly,项目名称:ijr,代码行数:30,代码来源:index.php


示例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">&larr;</span> ' . __('Older posts', 'blue-planet'), 'next_text' => __('Newer posts', 'blue-planet') . ' <span class="meta-nav">&rarr;</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 -->
开发者ID:jbbythebch,项目名称:client1wp_test,代码行数:31,代码来源:search.php


示例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 {
    ?>
开发者ID:michellekusold,项目名称:taasc,代码行数:29,代码来源:search.php


示例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(); ?>
开发者ID:hoffmander,项目名称:banana-theme,代码行数:31,代码来源:index.php


示例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();
开发者ID:pixiebox,项目名称:wordpress-theme-one-page,代码行数:31,代码来源:index.php


示例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' => '&larr; %title', 'prev_text' => '%title &rarr;'));
    ?>

                <?php 
}
?>
            </div>

            <div class="col-md-3">

                <?php 
get_sidebar();
?>

            </div>
        </div>
开发者ID:LinaPeterssonOberg,项目名称:exam,代码行数:30,代码来源:single.php


示例16: the_post_thumbnail

        if (has_post_thumbnail()) {
            the_post_thumbnail('thumbnail', array('class' => 'search-thumbnail alignright'));
        }
        ?>

					<?php 
        the_excerpt();
        ?>
				</div><!-- .entry-summary -->

			</article><!-- #post-## -->


			<?php 
    }
    the_posts_navigation(array('prev_text' => __('More Results'), 'next_text' => __('Previous Results')));
} else {
    ?>

			<h1 class="search-results-title">
			No results found on <?php 
    echo $displaydomain;
    ?>
 for: 
			<nobr><strong><?php 
    echo get_search_query();
    ?>
</strong></nobr>
			</h1>

		<?php 
开发者ID:chromasites,项目名称:Chroma-Theme,代码行数:31,代码来源:search.php


示例17: get_template_part

<?php

get_template_part('templates/page', 'header');
?>

<?php 
if (!have_posts()) {
    ?>
    <div class="alert alert-warning">
        <?php 
    _e('Sorry, no results were found.', 'sage');
    ?>
    </div>
    <?php 
    get_search_form();
}
?>

<?php 
while (have_posts()) {
    the_post();
    ?>
    <?php 
    get_template_part('templates/content', 'search');
}
?>

<?php 
the_posts_navigation(['prev_text' => __('More search results', 'sage'), 'next_text' => __('Previous results', 'sage'), 'screen_reader_text' => __('Results navigation', 'sage')]);
开发者ID:sinaru,项目名称:Sonder-WordPress-Theme,代码行数:29,代码来源:search.php


示例18: posts_nav

 /**
  * Adds the posts navigation
  *
  * @return 		mixed 			The posts navigation
  */
 public function posts_nav()
 {
     if (!is_search() || !is_home() || !is_archive()) {
         return;
     }
     the_posts_navigation();
 }
开发者ID:dccmarketing,项目名称:dpd-2015,代码行数:12,代码来源:themehooks.php


示例19: get_template_part

<?php

get_template_part('templates/page', 'header');
?>

<?php 
if (!have_posts()) {
    ?>
  <div class="alert alert-warning">
    <?php 
    _e('Sorry, no results were found.', 'sage');
    ?>
  </div>
  <?php 
    get_search_form();
}
?>

<?php 
while (have_posts()) {
    the_post();
    ?>
  <?php 
    get_template_part('templates/content', get_post_type() != 'post' ? get_post_type() : get_post_format());
}
?>

<?php 
the_posts_navigation(array('prev_text' => __('Older <span class="xdico-rarr"></span>', 'cm'), 'next_text' => __('<span class="xdico-larr"></span> Newer', 'cm')));
开发者ID:SirNeuman,项目名称:xd2,代码行数:29,代码来源:index.php


示例20: wp_reset_query

    }
    wp_reset_query();
    ?>
			<?php 
} else {
    ?>
				<h2>No posts found</h2>
			<?php 
}
?>

			<?php 
if ($wp_query->max_num_pages > 1) {
    ?>
				<?php 
    the_posts_navigation(array('next_text' => '<span class="meta-nav" aria-hidden="true">' . __('Next:', 'onepixel') . '</span> ' . '<span class="screen-reader-text">' . __('Newer posts &rarr;', 'onepixel') . '</span> ', 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __('Previous:', 'onepixel') . '</span> ' . '<span class="screen-reader-text">' . __('&larr; Older posts', 'onepixel') . '</span> '));
    ?>
			<?php 
}
?>
		</div>

		<?php 
if (is_active_sidebar('main-sidebar')) {
    ?>
		<?php 
    get_sidebar('main-sidebar');
    ?>
		<?php 
}
?>
开发者ID:pixiebox,项目名称:wordpress-theme-one-page,代码行数:31,代码来源:archive.php



注:本文中的the_posts_navigation函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP the_posts_pagination函数代码示例发布时间:2022-05-23
下一篇:
PHP the_post_thumbnail_url函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap