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


PHP loop_pagination函数代码示例

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


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

示例1: omega_content_nav

    /**
     * Display navigation to next/previous pages when applicable
     */
    function omega_content_nav()
    {
        global $wp_query, $post;
        // Don't print empty markup on single pages if there's nowhere to navigate.
        if (is_single()) {
            $previous = is_attachment() ? get_post($post->post_parent) : get_adjacent_post(false, '', true);
            $next = get_adjacent_post(false, '', false);
            if (!$next && !$previous) {
                return;
            }
        }
        if (is_singular() && !get_theme_mod('single_nav', 0)) {
            return;
        }
        // Don't print empty markup in archives if there's only one page.
        if ($wp_query->max_num_pages < 2 && (is_home() || is_archive() || is_search())) {
            return;
        }
        $nav_class = is_single() ? 'post-navigation' : 'paging-navigation';
        ?>
	<nav role="navigation" id="nav-below" class="navigation  <?php 
        echo $nav_class;
        ?>
">

	<?php 
        if (is_single() && get_theme_mod('single_nav', 0)) {
            // navigation links for single posts
            ?>

		<?php 
            previous_post_link('<div class="nav-previous alignleft">%link</div>', '<span class="meta-nav">' . _x('&larr;', 'Previous post link', 'omega') . '</span> %title');
            ?>
		<?php 
            next_post_link('<div class="nav-next alignright">%link</div>', '%title <span class="meta-nav">' . _x('&rarr;', 'Next post link', 'omega') . '</span>');
            ?>

	<?php 
        } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) {
            // navigation links for home, archive, and search pages
            ?>

		<?php 
            loop_pagination();
            ?>

	<?php 
        }
        ?>

	</nav><!-- #nav-below -->
	<?php 
    }
开发者ID:traviswright,项目名称:matterandspirit,代码行数:56,代码来源:template-tags.php

示例2: elseif

	<?php 
} elseif (is_singular('post')) {
    ?>


		<div class="loop-nav">
			<?php 
    previous_post_link('%link', '<span class="previous">' . __('<span class="meta-nav">&larr;</span> Previous', hybrid_get_textdomain()) . '</span>');
    ?>
			<?php 
    next_post_link('%link', '<span class="next">' . __('Next <span class="meta-nav">&rarr;</span>', hybrid_get_textdomain()) . '</span>');
    ?>
		</div><!-- .loop-nav -->

	<?php 
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination(array('prev_text' => __('<span class="meta-nav">&larr;</span> Previous', hybrid_get_textdomain()), 'next_text' => __('Next <span class="meta-nav">&rarr;</span>', hybrid_get_textdomain())));
    ?>

	<?php 
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('<span class="meta-nav">&larr;</span> Previous', hybrid_get_textdomain()) . '</span>', 'nxtlabel' => '<span class="next">' . __('Next &rarr;', hybrid_get_textdomain()) . '</span>')))) {
    ?>

		<div class="loop-nav">
			<?php 
    echo $nav;
    ?>
		</div><!-- .loop-nav -->

	<?php 
}
开发者ID:rzb,项目名称:boletos2,代码行数:31,代码来源:loop-nav.php

示例3: tamatebako_archive_footer

/**
 * Archive Footer (Pagination)
 *
 * @since 0.1.0
 */
function tamatebako_archive_footer()
{
    ?>

	<?php 
    if (is_home() || is_archive() || is_search()) {
        ?>

		<?php 
        loop_pagination(array('prev_text' => '<span class="screen-reader-text">' . tamatebako_string('previous') . '</span>', 'next_text' => '<span class="screen-reader-text">' . tamatebako_string('next') . '</span>', 'end_size' => 3, 'mid_size' => 3));
        ?>

	<?php 
    }
    ?>

<?php 
}
开发者ID:Harreh,项目名称:magicowl,代码行数:23,代码来源:tamatebako.php

示例4: elseif

	<?php 
} elseif (is_singular('post')) {
    ?>

		<div class="loop-nav">
			<?php 
    previous_post_link('%link', '<span class="previous">' . __('<span class="meta-nav">&larr;</span> Previous', 'bearded') . '</span>');
    ?>
			<?php 
    next_post_link('%link', '<span class="next">' . __('Next <span class="meta-nav">&rarr;</span>', 'bearded') . '</span>');
    ?>
		</div><!-- .loop-nav -->

	<?php 
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination(array('prev_text' => __('Previous', 'bearded'), 'next_text' => __('Next', 'bearded')));
    ?>

	<?php 
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('Previous', 'bearded') . '</span>', 'nxtlabel' => '<span class="next">' . __('Next', 'bearded') . '</span>')))) {
    ?>

		<div class="loop-nav">
			<?php 
    echo $nav;
    ?>
		</div><!-- .loop-nav -->

	<?php 
}
开发者ID:jahir07,项目名称:bearded,代码行数:30,代码来源:loop-nav.php

示例5: previous_post_link

			<?php previous_post_link( '<div class="previous"><span>' . __( 'Previous Post ', hybrid_get_parent_textdomain() ) . '</span>' . __('%link', hybrid_get_parent_textdomain()) . '</div>', '%title' ); ?>
			
			<?php /*
			<div class="previous">
				<?php previous_post_link( '<span>' . __('%link', hybrid_get_parent_textdomain() ) . '</span>','Previous Post'); ?>
				<?php previous_post_link( '%link','%title'); ?>
			</div>
			*/ ?>
			
			<?php next_post_link( '<div class="next"><span>' . __( 'Next Post ', hybrid_get_parent_textdomain() ) . '</span>' . __('%link', hybrid_get_parent_textdomain()) . '</div>', '%title' ); ?>
			
			<?php /*
			<div class="next">
				<?php next_post_link( '<span>' . __('%link', hybrid_get_parent_textdomain() ) . '</span>','Next Post'); ?>
				<?php next_post_link( '%link','%title'); ?>
			</div>
			*/ ?>
			
			<div class="clear"></div>
		</div><!-- .loop-nav -->

	<?php elseif ( !is_singular() && current_theme_supports( 'loop-pagination' ) ) : loop_pagination(); ?>

	<?php elseif ( !is_singular() && $nav = get_posts_nav_link( array( 'sep' => '', 'prelabel' => '<span class="previous">' . __( '&larr; Previous', hybrid_get_parent_textdomain() ) . '</span>', 'nxtlabel' => '<span class="next">' . __( 'Next &rarr;', hybrid_get_parent_textdomain() ) . '</span>' ) ) ) : ?>

		<div class="loop-nav">
			<?php echo $nav; ?>
		</div><!-- .loop-nav -->

	<?php endif; ?>
开发者ID:ryannmicua,项目名称:Pogidude-Hybrid,代码行数:30,代码来源:loop-nav.php

示例6: array

 * @package Pogidude
 * @subpackage Template
 */
?>
	<?php $loop_args = array(	'end_size' => 2,
								'mid_size' => 2
							);
	?>
							
	<?php if ( is_attachment() ) : ?>

		<div class="loop-nav">
			<?php previous_post_link( '%link', '<span class="previous">' . __( '&larr; Return to entry', 'cleanaire' ) . '</span>' ); ?>
		</div><!-- .loop-nav -->

	<?php elseif ( is_singular( 'post' ) ) : ?>

		<div class="loop-nav">
			<?php previous_post_link( '<div class="previous">' . __( 'Previous Entry: %link', 'cleanaire' ) . '</div>', '%title' ); ?>
			<?php next_post_link( '<div class="next">' . __( 'Next Entry: %link', 'cleanaire' ) . '</div>', '%title' ); ?>
		</div><!-- .loop-nav -->

	<?php elseif ( !is_singular() ) : loop_pagination( $loop_args ); ?>

	<?php elseif ( !is_singular() && $nav = get_posts_nav_link( array( 'sep' => '', 'prelabel' => '<span class="previous">' . __( '&larr; Previous', 'cleanaire' ) . '</span>', 'nxtlabel' => '<span class="next">' . __( 'Next &rarr;', 'cleanaire' ) . '</span>' ) ) ) : ?>

		<div class="loop-nav">
			<?php echo $nav; ?>
		</div><!-- .loop-nav -->

	<?php endif; ?>
开发者ID:ryannmicua,项目名称:Pogidude-Hybrid,代码行数:31,代码来源:loop-nav.php

示例7: _e

			<h3 class="assistive-text"><?php 
    _e('Post navigation', 'cakifo');
    ?>
</h3>
			<?php 
    previous_post_link('%link', '<span class="previous">&larr; %title</span>');
    ?>
			<?php 
    next_post_link('%link', '<span class="next">%title &rarr;</span>');
    ?>
		</nav> <!-- .pagination.post-pagination -->

	<?php 
    // Pagination if the theme supports "loop-pagination"
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination(array('before' => '<nav class="pagination loop-pagination"><h3 class="assistive-text">' . __('Post navigation', 'cakifo') . '</h3>', 'after' => '</nav>', 'mid_size' => 2, 'prev_text' => __('&larr; Previous', 'cakifo'), 'next_text' => __('Next &rarr;', 'cakifo')));
    // Normal 'Previous' and 'Next' links
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('&larr; Previous', 'cakifo') . '</span>', 'nxtlabel' => '<span class="next">' . __('Next &rarr;', 'cakifo') . '</span>')))) {
    ?>

		<nav class="pagination">
			<h3 class="assistive-text"><?php 
    _e('Post navigation', 'cakifo');
    ?>
</h3>
			<?php 
    echo $nav;
    ?>
		</nav> <!-- .pagination.loop-pagination -->

	<?php 
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:31,代码来源:loop-nav.php

示例8: omega_content_nav

    /**
     * Display navigation to next/previous pages when applicable
     */
    function omega_content_nav($nav_id)
    {
        global $wp_query, $post;
        // Don't print empty markup on single pages if there's nowhere to navigate.
        if (is_single()) {
            $previous = is_attachment() ? get_post($post->post_parent) : get_adjacent_post(false, '', true);
            $next = get_adjacent_post(false, '', false);
            if (!$next && !$previous) {
                return;
            }
        }
        // Don't print empty markup in archives if there's only one page.
        if ($wp_query->max_num_pages < 2 && (is_home() || is_archive() || is_search())) {
            return;
        }
        $nav_class = is_single() ? 'post-navigation' : 'paging-navigation';
        ?>
	<nav role="navigation" id="<?php 
        echo esc_attr($nav_id);
        ?>
" class="navigation  <?php 
        echo $nav_class;
        ?>
">

	<?php 
        if (is_single() && !omega_get_setting('single_nav')) {
            // navigation links for single posts
            ?>

		<?php 
            previous_post_link('<div class="nav-previous alignleft">%link</div>', '<span class="meta-nav">' . _x('&larr;', 'Previous post link', 'omega') . '</span> %title');
            ?>
		<?php 
            next_post_link('<div class="nav-next alignright">%link</div>', '%title <span class="meta-nav">' . _x('&rarr;', 'Next post link', 'omega') . '</span>');
            ?>

	<?php 
        } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) {
            // navigation links for home, archive, and search pages
            ?>

		<?php 
            if (current_theme_supports('loop-pagination') && 'numeric' == omega_get_setting('posts_nav')) {
                loop_pagination();
            } else {
                if (get_next_posts_link()) {
                    ?>
			<div class="nav-previous alignleft"><?php 
                    next_posts_link(__('<span class="meta-nav">&larr;</span> Previous Page', 'omega'));
                    ?>
</div>
			<?php 
                }
                ?>

			<?php 
                if (get_previous_posts_link()) {
                    ?>
			<div class="nav-next alignright"><?php 
                    previous_posts_link(__('Next Page <span class="meta-nav">&rarr;</span>', 'omega'));
                    ?>
</div>
			<?php 
                }
            }
            ?>

	<?php 
        }
        ?>

	</nav><!-- #<?php 
        echo esc_html($nav_id);
        ?>
 -->
	<?php 
    }
开发者ID:ninthlink,项目名称:edtech,代码行数:81,代码来源:omega-template-tags.php

示例9: previous_post_link

<?php

if (is_singular('post')) {
    // If viewing a single post page.
    ?>

	<div class="loop-nav">
		<?php 
    previous_post_link('<div class="prev">' . __('Previous Post: %link', 'gomedia') . '</div>', '%title');
    ?>
		<?php 
    next_post_link('<div class="next">' . __('Next Post: %link', 'gomedia') . '</div>', '%title');
    ?>
	</div><!-- .loop-nav -->

<?php 
} elseif (is_home() || is_archive() || is_search()) {
    // If viewing the blog, an archive, or search results.
    ?>

	<?php 
    loop_pagination(array('prev_text' => _x('Previous', 'posts navigation', 'gomedia'), 'next_text' => _x('Next', 'posts navigation', 'gomedia'), 'before' => '<nav class="loop-pagination"><ul class="pagination">', 'after' => '</ul></nav>'));
    ?>

<?php 
}
// End check for type of page being viewed.
开发者ID:phupx,项目名称:phamlook,代码行数:27,代码来源:loop-nav.php

示例10: previous_post_link

/**
 * A template part to display single entry navigation and pagination for archives.
 *
 * @package     Compass
 * @subpackage  HybridCore
 * @copyright   Copyright (c) 2014, Flagship, LLC
 * @license     GPL-2.0+
 * @link        http://flagshipwp.com/
 * @since       1.0.0
 */
?>

<?php 
if (is_singular('post')) {
    ?>

	<nav class="nav-single">
		<?php 
    previous_post_link('<span class="nav-previous">' . __('%link', 'compass') . '</span>', '&larr; Previous Post');
    ?>
		<?php 
    next_post_link('<span class="nav-next">' . __('%link', 'compass') . '</span>', 'Next Post &rarr;');
    ?>
	</nav><!-- .nav-singl -->

	<?php 
}
if (is_home() || is_archive() || is_search()) {
    loop_pagination(array('prev_text' => '<span class="screen-reader-text">' . __('Previous Page', 'compass') . '</span>', 'next_text' => '<span class="screen-reader-text">' . __('Next Page', 'compass') . '</span>'));
}
开发者ID:stedy67,项目名称:Compass,代码行数:30,代码来源:loop-nav.php

示例11: elseif

	<?php 
} elseif (is_singular('post')) {
    ?>

		<nav class="loop-nav">
			<?php 
    previous_post_link('%link', '<span class="previous">' . __('&larr; Previous', 'melange') . '</span>');
    ?>
			<?php 
    next_post_link('%link', '<span class="next">' . __('Next &rarr;', 'melange') . '</span>');
    ?>
		</nav>

	<?php 
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination(array('prev_text' => __('&larr; Previous', 'melange'), 'next_text' => __('Next &rarr;', 'melange')));
    ?>

	<?php 
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('&larr; Previous', 'melange') . '</span>', 'nxtlabel' => '<span class="next">' . __('Next &rarr;', 'melange') . '</span>')))) {
    ?>

		<nav class="loop-nav">
			<?php 
    echo $nav;
    ?>
		</nav><!-- .loop-nav -->

	<?php 
}
开发者ID:spigotdesign,项目名称:melange,代码行数:30,代码来源:loop-nav.php

示例12: elseif

	<?php 
} elseif (is_singular('post')) {
    ?>

		<nav class="loop-nav">
			<?php 
    previous_post_link('%link', '<span class="previous">' . __('&larr; Previous', 'infusion') . '</span>');
    ?>
			<?php 
    next_post_link('%link', '<span class="next">' . __('Next &rarr;', 'infusion') . '</span>');
    ?>
		</nav>

	<?php 
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination(array('prev_text' => __('&larr; Previous', 'infusion'), 'next_text' => __('Next &rarr;', 'infusion')));
    ?>

	<?php 
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('&larr; Previous', 'infusion') . '</span>', 'nxtlabel' => '<span class="next">' . __('Next &rarr;', 'infusion') . '</span>')))) {
    ?>

		<nav class="loop-nav">
			<?php 
    echo $nav;
    ?>
		</nav><!-- .loop-nav -->

	<?php 
}
开发者ID:emkal,项目名称:Infusion,代码行数:30,代码来源:loop-nav.php

示例13: previous_post_link

<?php

if (is_singular('post')) {
    // If viewing a single post page.
    ?>

	<div class="loop-nav">
		<?php 
    previous_post_link('<div class="prev">' . __('Previous Post: %link', 'hybrid-base') . '</div>', '%title');
    ?>
		<?php 
    next_post_link('<div class="next">' . __('Next Post: %link', 'hybrid-base') . '</div>', '%title');
    ?>
	</div><!-- .loop-nav -->

<?php 
} elseif (is_home() || is_archive() || is_search()) {
    // If viewing the blog, an archive, or search results.
    ?>

	<?php 
    loop_pagination(array('prev_text' => _x('&larr; Previous', 'posts navigation', 'hybrid-base'), 'next_text' => _x('Next &rarr;', 'posts navigation', 'hybrid-base')));
    ?>

<?php 
}
// End check for type of page being viewed.
开发者ID:devmatt,项目名称:hybrid-base,代码行数:27,代码来源:loop-nav.php

示例14: elseif

	<?php 
} elseif (is_singular('post')) {
    ?>

		<div class="loop-nav">
			<?php 
    previous_post_link('%link', '<span class="previous">' . __('<span class="meta-nav">&larr;</span> Previous', 'my-life') . '</span>');
    ?>
			<?php 
    next_post_link('%link', '<span class="next">' . __('Next <span class="meta-nav">&rarr;</span>', 'my-life') . '</span>');
    ?>
		</div><!-- .loop-nav -->

	<?php 
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination(array('prev_text' => __('<span class="meta-nav">&larr;</span> Previous', 'my-life'), 'next_text' => __('Next <span class="meta-nav">&rarr;</span>', 'my-life')));
    ?>

	<?php 
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('<span class="meta-nav">&larr;</span> Previous', 'my-life') . '</span>', 'nxtlabel' => '<span class="next">' . __('Next &rarr;', 'my-life') . '</span>')))) {
    ?>

		<div class="loop-nav">
			<?php 
    echo $nav;
    ?>
		</div><!-- .loop-nav -->

	<?php 
}
开发者ID:panser,项目名称:wandromaha,代码行数:30,代码来源:loop-nav.php

示例15: elseif

<?php 
} elseif (is_singular('post')) {
    ?>

    <div class="loop-nav">
        <?php 
    previous_post_link('<div class="previous">' . __('&larr; %link', 'origin') . '</div>', '%title');
    ?>
        <?php 
    next_post_link('<div class="next">' . __('%link', 'origin') . ' &rarr;</div>', '%title');
    ?>
    </div><!-- .loop-nav -->

<?php 
} elseif (!is_singular() && current_theme_supports('loop-pagination')) {
    loop_pagination();
    ?>

<?php 
} elseif (!is_singular() && ($nav = get_posts_nav_link(array('sep' => '', 'prelabel' => '<span class="previous">' . __('&larr; Previous', 'origin') . '</span>', 'nxtlabel' => '<span class="next">' . __('Next &rarr;', 'origin') . '</span>')))) {
    ?>

    <div class="loop-nav">
        <?php 
    echo $nav;
    ?>
    </div><!-- .loop-nav -->

<?php 
}
开发者ID:ARTSAT,项目名称:artsat-jp-themes,代码行数:30,代码来源:loop-nav.php


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