本文整理汇总了PHP中the_post_navigation函数的典型用法代码示例。如果您正苦于以下问题:PHP the_post_navigation函数的具体用法?PHP the_post_navigation怎么用?PHP the_post_navigation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_post_navigation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vtstheme_entry_footer
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function vtstheme_entry_footer()
{
// Hide category and tag text for pages.
if ('post' === get_post_type()) {
/* translators: used between list items, there is a space after the comma */
// $categories_list = get_the_category_list( esc_html__( ', ', 'vtstheme' ) );
// if ( $categories_list && vtstheme_categorized_blog() && strpos($categories_list,'Uncategorized') === false ) {
// printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', 'vtstheme' ) . '</span>', $categories_list ); // WPCS: XSS OK.
// }
/* translators: used between list items, there is a space after the comma */
// $tags_list = get_the_tag_list( '', esc_html__( ', ', 'vtstheme' ) );
// if ( $tags_list ) {
// printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', 'vtstheme' ) . '</span>', $tags_list ); // WPCS: XSS OK.
// }
the_post_navigation(['prev_text' => '<i class="fa fa-chevron-left"></i>Prev', 'next_text' => 'Next<i class="fa fa-chevron-right"></i>']);
echo '<a id="share-toggle" class="button secondary share"><i class="fa fa-share"></i> Share</a>';
naked_social_share_buttons();
}
// if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
// echo '<span class="comments-link">';
// comments_popup_link( esc_html__( 'Leave a comment', 'vtstheme' ), esc_html__( '1 Comment', 'vtstheme' ), esc_html__( '% Comments', 'vtstheme' ) );
// echo '</span>';
// }
// edit_post_link( esc_html__( 'Edit', 'vtstheme' ), '<span class="edit-link">', '</span>' );
}
示例2: ultra_posted_on
/**
* Prints HTML with meta information for the current post-date/time, author, comment count and categories.
*/
function ultra_posted_on()
{
echo '<div class="entry-meta-inner">';
if (is_sticky() && is_home() && !is_paged()) {
echo '<span class="featured-post">' . __('Sticky', 'ultra') . '</span>';
}
if (is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date')) {
echo '<span class="entry-date"><a href="' . esc_url(get_permalink()) . '" rel="bookmark"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span></a>';
}
if (is_single() && siteorigin_setting('blog_post_date')) {
echo '<span class="entry-date"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span>';
}
if (siteorigin_setting('blog_post_author')) {
echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '" rel="author">' . esc_html(get_the_author()) . '</a></span></span>';
}
if (comments_open() && siteorigin_setting('blog_post_comment_count')) {
echo '<span class="comments-link">';
comments_popup_link(__('Leave a comment', 'ultra'), __('1 Comment', 'ultra'), __('% Comments', 'ultra'));
echo '</span>';
}
echo '</div>';
if (is_single() && siteorigin_setting('navigation_post_nav')) {
the_post_navigation($args = array('prev_text' => '', 'next_text' => ''));
}
}
示例3: avocation_pagination
function avocation_pagination()
{
if (is_single()) {
the_post_navigation(array('prev_text' => '<div class="avocation_previous_pagination alignleft">%title</div>', 'next_text' => '<div class="avocation_next_pagination alignright">%title</div>'));
} else {
the_posts_pagination(array('prev_text' => '<i class="fa fa-angle-double-left"></i>', 'next_text' => '<i class="fa fa-angle-double-right"></i>', 'before_page_number' => '<span class="meta-nav screen-reader-text"></span>'));
}
}
示例4: multishop_pagination
function multishop_pagination()
{
?>
<div class="col-md-12 multishop-default-pagination ">
<?php
if (is_single()) {
the_post_navigation(array('next_text' => '<span class="multishop_next_pagination meta-nav" aria-hidden="true">%title</span>', 'prev_text' => '<span class="multishop_previous_pagination meta-nav" aria-hidden="true">%title</span>'));
} else {
the_posts_pagination(array('prev_text' => __('<<'), 'next_text' => __('>>'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'multishop') . ' </span>'));
}
?>
</div>
<?php
}
示例5: twentyfifteen_entry_meta
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php twentyfifteen_entry_meta(); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
// Previous/next post navigation.
the_post_navigation( array(
'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ),
) );
// End the loop.
endwhile;
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_footer(); ?>
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
示例6: dynamicnews_display_post_navigation
function dynamicnews_display_post_navigation()
{
// Get Theme Options from Database
$theme_options = dynamicnews_theme_options();
if (true == $theme_options['post_navigation']) {
the_post_navigation(array('prev_text' => '« %title', 'next_text' => '%title »'));
}
}
示例7: get_header
* The template for displaying all single posts and attachments
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/
get_header();
?>
<?php
// Start the loop.
while (have_posts()) {
the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', get_post_format());
// If comments are open or we have at least one comment, load up the comment template.
// if ( comments_open() || get_comments_number() ) :
// comments_template();
// endif;
// Previous/next post navigation.
the_post_navigation(array('next_text' => '<span class="meta-nav next" aria-hidden="true">' . __('NEXT', 'twentyfifteen') . '</span>', 'prev_text' => '<span class="meta-nav prev" aria-hidden="true">' . __('PREVIOUS', 'twentyfifteen') . '</span>'));
// End the loop.
}
?>
<?php
get_footer();
示例8: the_permalink
<h3><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a><span><?php
the_date_xml();
?>
</span></h3>
<p><?php
the_content();
?>
</p>
</div>
</div>
<div class="row page_nav">
<div class="col-xs-10">
<?php
the_post_navigation(array('next_text' => '<div class="col-xs-4" style="float: right"><p>' . __('Наступна стаття: ', 'example') . '<span class="post-title">%title</span></p></div>', 'prev_text' => '<div class="col-xs-4" style="float: left"><p>' . __('Попередня стаття: ', 'example') . '<span class="post-title">%title</span></p></div>', 'screen_reader_text' => ' '));
}
?>
</div>
</div>
<!--<?php
/*get_sidebar(); */
?>
-->
</div><!--/DIV CONTENT -->
<?php
get_footer();
示例9: wp_link_pages
wp_link_pages(array('before' => '<div class="page-links u-textAlignCenter comment-navigation">', 'after' => '</div>', 'link_before' => '<span class="page-link-item">', 'link_after' => '</span>', 'pagelink' => '%', 'separator' => '<span class="screen-reader-text">, </span>'));
?>
<div class="post--keywords" itemprop="keywords">
<?php
echo puma_get_the_term_list(get_the_ID(), 'post_tag');
?>
</div>
<div class="postFooterAction">
<?php
if (function_exists('wp_postlike')) {
wp_postlike();
}
?>
</div>
<?php
the_post_navigation(array('next_text' => '<span class="meta-nav">Next</span><span class="post-title">%title</span>', 'prev_text' => '<span class="meta-nav">Previous</span><span class="post-title">%title</span>'));
?>
<div class="postFooterinfo u-textAlignCenter">
<?php
echo get_avatar(get_the_author_meta('email'), 64);
?>
<h3 class="author-name"><?php
the_author();
?>
</h3>
<div class="author-description"><?php
echo get_the_author_meta('description');
?>
</div>
<div class="author-meta">
<?php
示例10: get_header
* @package bobderrico
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while (have_posts()) {
the_post();
get_template_part('template-parts/hero', 'single-job');
?>
<div class="content-wrap">
<?php
get_template_part('template-parts/content', 'single-job');
the_post_navigation(['prev_text' => '← ' . __('Previous Job', 'bobderrico'), 'next_text' => __('Next Job', 'bobderrico;') . ' →']);
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
}
// End of the loop.
?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();
示例11: eighteen_tags_post_nav
/**
* Display navigation to next/previous post when applicable.
*/
function eighteen_tags_post_nav()
{
$args = array('next_text' => '%title <span class="meta-nav">→</span>', 'prev_text' => '<span class="meta-nav">←</span> %title');
the_post_navigation($args);
}
示例12: get_header
*/
get_header();
?>
<?php
/* Start the Loop */
?>
<?php
while (have_posts()) {
the_post();
?>
<?php
get_template_part('content/content', get_post_type());
?>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
// Previous/next post navigation.
the_post_navigation(array('next_text' => '<span class="meta-nav nav-next">' . __('Next post', 'peek') . ': %title</span>', 'prev_text' => '<span class="meta-nav nav-previous">' . __('Previous post', 'peek') . ': %title</span>'));
?>
<?php
}
?>
<?php
get_footer();
示例13: while
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
// Start the loop.
while (have_posts()) {
the_post();
// Include the single post content template.
get_template_part('template-parts/content', 'single');
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
if (is_singular('attachment')) {
// Parent post navigation.
the_post_navigation(array('prev_text' => _x('<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'tpbc')));
} elseif (is_singular('post')) {
// Previous/next post navigation.
the_post_navigation(array('next_text' => '<span class="screen-reader-text">' . __('Next post:', 'tpbc') . '</span> ' . '<span class="post-title">%title</span>', 'prev_text' => '<span class="screen-reader-text">' . __('Previous post:', 'tpbc') . '</span> ' . '<span class="post-title">%title</span>'));
}
// End of the loop.
}
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php
get_sidebar();
get_footer();
示例14: the_post_thumbnail
if (has_post_thumbnail()) {
the_post_thumbnail();
}
?>
<?php
the_content();
?>
<?php
wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'wanderlist'), 'after' => '</div>'));
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php
the_post_navigation(array('prev_text' => '<span>Previous</span> %title', 'next_text' => '<span>Next</span> %title'));
?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
<?php
if (comments_open() || get_comments_number()) {
comments_template();
}
?>
<?php
}
// end of the loop.
?>
示例15: comments_template
if (comments_open() || get_comments_number()) {
?>
<?php
comments_template();
?>
<?php
}
?>
<?php
if (is_singular('attachment')) {
// Parent post navigation.
the_post_navigation(array('prev_text' => _x('<span class="meta-nav">Published in</span>' . '<span class="post-title">%title</span>', 'Parent post link', 'AQUNTALLC_SITENAME')));
} elseif (is_singular('post')) {
// Previous/next post navigation.
the_post_navigation(array('prev_text' => '<span class="meta-nav pull-left" aria-hidden="true">' . '<i class="fa fa-chevron-left"></i>' . ' <span class="post-title">%title</span>' . '</span>', 'next_text' => '<span class="meta-nav pull-right" aria-hidden="true">' . '<span class="post-title">%title</span>' . ' <i class="fa fa-chevron-right"></i>' . '</span>', 'screen_reader_text' => __('Other Articles')));
echo "<div class=\"clearfix\"> </div><hr/>";
}
?>
<?php
}
// End of the loop.
?>
<?php
get_sidebar('article-after');
?>
</div><!-- .single-content -->