当前位置: 首页>>代码示例>>PHP>>正文


PHP the_posts_navigation函数代码示例

本文整理汇总了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();
    }
}
开发者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


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