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


PHP previous_posts_link函数代码示例

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


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

示例1: woo_pagenav

    function woo_pagenav($custom_query = '')
    {
        global $woo_options, $wp_query, $paged, $page;
        // Set query max pages
        $max_pages = 1;
        if ('' != $custom_query) {
            $max_pages = $custom_query->max_num_pages;
        } else {
            $max_pages = $wp_query->max_num_pages;
        }
        // If the user has set the option to use simple paging links, display those. By default, display the pagination.
        if (@$woo_options['woo_pagination_type'] == 'simple') {
            if (get_next_posts_link('', $max_pages) || get_previous_posts_link()) {
                ?>
            <div class="nav-entries">
                <?php 
                next_posts_link('<span class="nav-prev fl"><i class="icon-angle-left"></i> ' . __('Older posts', 'woothemes') . '</span>', $max_pages);
                ?>
                <?php 
                previous_posts_link('<span class="nav-next fr">' . __('Newer posts', 'woothemes') . ' <i class="icon-angle-right"></i></span>');
                ?>
                <div class="fix"></div>
            </div>
		<?php 
            }
            // End IF Statement
        } else {
            woo_pagination(array(), $custom_query);
        }
        // End IF Statement
    }
开发者ID:klgrimley,项目名称:mzf,代码行数:31,代码来源:theme-functions.php

示例2: cleanblog_posts_navigation

    /**
     * Display navigation to next/previous set of posts when applicable.
     *
     * @todo Remove this function when WordPress 4.3 is released.
     */
    function cleanblog_posts_navigation()
    {
        // Don't print empty markup if there's only one page.
        if ($GLOBALS['wp_query']->max_num_pages < 2) {
            return;
        }
        ?>
	<ul class="pager">
		<?php 
        if (get_next_posts_link()) {
            ?>
		<li class="next"><?php 
            next_posts_link(esc_html__('Older posts', 'cleanblog'));
            ?>
</li>
		<?php 
        }
        ?>
		<?php 
        if (get_previous_posts_link()) {
            ?>
		<li class="previous"><?php 
            previous_posts_link(esc_html__('Newer posts', 'cleanblog'));
            ?>
</li>
		<?php 
        }
        ?>
	</ul>
	<?php 
    }
开发者ID:alesanchezr,项目名称:personal-blog,代码行数:36,代码来源:template-tags.php

示例3: twentyeleven_content_nav

/**
 * Display navigation to next/previous pages when applicable
 */
function twentyeleven_content_nav($nav_id)
{
    global $wp_query;
    if ($wp_query->max_num_pages > 1) {
        ?>

		<nav id="<?php 
        echo $nav_id;
        ?>
">

			<h3 class="assistive-text"><?php 
        _e('Post navigation', 'twentyeleven');
        ?>
</h3>

			<div class="nav-previous"><?php 
        next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', 'twentyeleven'));
        ?>
</div>

			<div class="nav-next"><?php 
        previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', 'twentyeleven'));
        ?>
</div>

		</nav><!-- #nav-above -->

	<?php 
    }
}
开发者ID:keplerf,项目名称:Partybuses.ca,代码行数:34,代码来源:functions.php

示例4: response_newer_posts

/**
* Sets up the next post link and applies a filter to the link text. 
*
* @since 1.0
*/
function response_newer_posts()
{
    $newer_text = apply_filters('response_newer_posts_text', 'Newer Entries &raquo;');
    echo "<div class='pagprev-posts'>";
    previous_posts_link(__($newer_text, 'response'));
    echo "</div>";
}
开发者ID:nodejs-es,项目名称:nodejs-es-media,代码行数:12,代码来源:pagination-actions.php

示例5: cactusthemes_content_nav

    /**
     * Displays navigation to next/previous pages when applicable.
     *
     * @since Twenty Twelve 1.0
     */
    function cactusthemes_content_nav($html_id, $custom_query = false)
    {
        global $wp_query;
        $current_query = $wp_query;
        if ($custom_query) {
            $current_query = $custom_query;
        }
        $html_id = esc_attr($html_id);
        if ($current_query->max_num_pages > 1) {
            ?>
		<nav id="<?php 
            echo $html_id;
            ?>
" class="navigation" role="navigation">
			<div class="nav-previous alignleft"><?php 
            next_posts_link(__('Older posts <span class="meta-nav">&rarr;</span>', 'cactusthemes'), $current_query->max_num_pages);
            ?>
</div>
			<div class="nav-next alignright"><?php 
            previous_posts_link(__('<span class="meta-nav">&larr;</span> Newer posts', 'cactusthemes'));
            ?>
</div>
		</nav><!-- #<?php 
            echo $html_id;
            ?>
 .navigation -->
	<?php 
        }
    }
开发者ID:hamednourhani,项目名称:naiau.ir,代码行数:34,代码来源:theme-core.php

示例6: sosimple_pagination

    /**
     * Print the previous and next links depending on the current template.
     */
    function sosimple_pagination()
    {
        global $wp_query;
        if (is_single()) {
            ?>
		<nav class="nav single-nav" role="navigation">
			<span class="home"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
"></a></span>
		</nav>
	<?php 
        } elseif ($wp_query->max_num_pages > 1 && (is_home() || is_archive() || is_search())) {
            ?>
		<nav class="nav paged-nav" role="navigation">
			<span class="previous"><?php 
            previous_posts_link('');
            ?>
</span>
			<span class="next"><?php 
            next_posts_link('');
            ?>
</span>
		</nav>
	<?php 
        }
    }
开发者ID:getcodebase,项目名称:so-simple,代码行数:30,代码来源:template-tags.php

示例7: zerif_paging_nav

    /**
     * Display navigation to next/previous set of posts when applicable.
     */
    function zerif_paging_nav()
    {
        echo '<div class="clear"></div>';
        ?>
	<nav class="navigation paging-navigation" role="navigation">
		<h1 class="screen-reader-text"><?php 
        _e('Posts navigation', 'zerif');
        ?>
</h1>
		<div class="nav-links">
			<?php 
        if (get_next_posts_link()) {
            ?>
			<div class="nav-previous"><?php 
            next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', 'zerif'));
            ?>
</div>
			<?php 
        }
        ?>
			<?php 
        if (get_previous_posts_link()) {
            ?>
			<div class="nav-next"><?php 
            previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', 'zerif'));
            ?>
</div>
			<?php 
        }
        ?>
		</div><!-- .nav-links -->
	</nav><!-- .navigation -->
	<?php 
    }
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:37,代码来源:template-tags.php

示例8: webonary_zeedisplay_page_navigation

/**
 * Common page navigation
 */
function webonary_zeedisplay_page_navigation()
{
    if (function_exists('wp_pagenavi')) {
        // if PageNavi is activated
        ?>
		<div class="more_posts">
			<?php 
        wp_pagenavi();
        // Use PageNavi
        ?>
		</div>
	<?php 
    } else {
        // Otherwise, use traditional Navigation
        ?>
		<div class="more_posts">
			<span class="post_links">
				<?php 
        previous_posts_link(__('&laquo; Previous Entries', ZEE_LANG));
        ?>
				<?php 
        next_posts_link(__('Next Entries &raquo;', ZEE_LANG)) & nbsp;
        ?>
			</span>
		</div>
	<?php 
    }
}
开发者ID:rick-maclean,项目名称:webonaryLinuxCopy,代码行数:31,代码来源:navigation.php

示例9: section_template

    function section_template()
    {
        ?>
		<?php 
        if (function_exists('wp_pagenavi') && show_posts_nav() && VPRO) {
            ?>
 
			<?php 
            wp_pagenavi();
            ?>
  
		<?php 
        } elseif (show_posts_nav()) {
            ?>
			<div class="page-nav-default fix">
				<span class="previous-entries"><?php 
            next_posts_link(__('&larr; Previous Entries', 'pagelines'));
            ?>
</span>
				<span class="next-entries"><?php 
            previous_posts_link(__('Next Entries &rarr;', 'pagelines'));
            ?>
</span>
			</div><!-- page nav -->
		<?php 
        }
        ?>
		
	<?php 
    }
开发者ID:rohans,项目名称:tradeinbooks,代码行数:30,代码来源:section.pagination.php

示例10: orbit_content_nav

    /**
     * Display navigation to next/previous pages when applicable
     */
    function orbit_content_nav($nav_id)
    {
        global $wp_query;
        ?>
	<nav id="<?php 
        echo $nav_id;
        ?>
">
		<ul>
		<?php 
        if (is_single()) {
            // navigation links for single posts
            ?>
		
			<li><?php 
            previous_post_link('%link', '' . _x('&larr;', 'Previous post link', 'orbit') . '%title');
            ?>
</li>
			<li><?php 
            next_post_link('%link', '%title' . _x('&rarr;', 'Next post link', 'orbit') . '');
            ?>
</li>

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

			<?php 
            if (get_next_posts_link()) {
                ?>
				<li><?php 
                next_posts_link(__('&larr; Older posts', 'orbit'));
                ?>
</li>
			<?php 
            }
            ?>

			<?php 
            if (get_previous_posts_link()) {
                ?>
				<li><?php 
                previous_posts_link(__('Newer posts &rarr;', 'orbit'));
                ?>
</li>
			<?php 
            }
            ?>

		<?php 
        }
        ?>
		</ul>
	</nav><!-- #<?php 
        echo $nav_id;
        ?>
 -->
	<?php 
    }
开发者ID:ryanurban,项目名称:Orbit,代码行数:63,代码来源:required.php

示例11: comicpress_pagination

function comicpress_pagination()
{
    global $post, $wp_query;
    if (function_exists('wp_pagenavi')) {
        ?>
		<?php 
        wp_pagenavi('<div id="wp-paginav">', '<div class="clear"></div></div>');
        ?>
	<?php 
    } else {
        ?>
		<div id="pagenav">
		<div class="pagenav-right"><?php 
        previous_posts_link(__('Newer Entries &uarr;', 'comicpress'));
        ?>
</div>
		<div class="pagenav-left"><?php 
        next_posts_link(__('&darr; Previous Entries', 'comicpress'));
        ?>
</div>
		<div class="clear"></div>
		</div>
	<?php 
    }
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:25,代码来源:pagination.php

示例12: silencio_paging_nav

    /**
     * Display navigation to next/previous set of posts when applicable.
     *
     * @return void
     */
    function silencio_paging_nav()
    {
        // Don't print empty markup if there's only one page.
        if ($GLOBALS['wp_query']->max_num_pages < 2) {
            return;
        }
        ?>
        <nav class="navigation paging-navigation" role="navigation">
            <div class="nav-links">

<?php 
        if (get_next_posts_link()) {
            ?>
                <div class="nav-previous"><?php 
            next_posts_link(__('<span class="meta-nav">&larr;</span> Older posts', 'silencio'));
            ?>
</div>
<?php 
        }
        if (get_previous_posts_link()) {
            ?>
                <div class="nav-next"><?php 
            previous_posts_link(__('Newer posts <span class="meta-nav">&rarr;</span>', 'silencio'));
            ?>
</div>
<?php 
        }
        ?>

            </div><!-- .nav-links -->
        </nav><!-- .navigation -->
<?php 
    }
开发者ID:shawncoots,项目名称:ehrlers,代码行数:38,代码来源:template-tags.php

示例13: cd_posts_navigation

    /**
     * Display navigation to next/previous set of posts when applicable.
     *
     * @todo Remove this function when WordPress 4.3 is released.
     */
    function cd_posts_navigation()
    {
        // Don't print empty markup if there's only one page.
        if ($GLOBALS['wp_query']->max_num_pages < 2) {
            return;
        }
        ?>
	<nav class="navigation posts-navigation" role="navigation">
		<h2 class="screen-reader-text"><?php 
        _e('Posts navigation', 'codediva');
        ?>
</h2>
		<div class="nav-links">

			
			<div class="nav-previous"><?php 
        next_posts_link(__('&larr; Older posts', 'underscores'));
        ?>
</div>
			
			
			<div class="nav-next"><?php 
        previous_posts_link(__('Newer posts &rarr;', 'underscores'));
        ?>
</div>
		</div><!-- .nav-links -->
	</nav><!-- .navigation -->
	<?php 
    }
开发者ID:syedhasb,项目名称:fluffy,代码行数:34,代码来源:template-tags.php

示例14: teaberry_content_nav

/**
 * displays navigation to next/previous pages when applicable.
 */
function teaberry_content_nav($html_id)
{
    global $wp_query;
    $html_id = esc_attr($html_id);
    if ($wp_query->max_num_pages > 1) {
        ?>

        <nav id="<?php 
        echo $html_id;
        ?>
" class="navigation" role="navigation">

            <div class="nav-previous">
                <?php 
        $text = __('<span class="meta-nav">&larr;</span> Older posts', 'teaberry');
        next_posts_link($text);
        ?>
            </div>

            <div class="nav-next">
                <?php 
        $text = __('Newer posts <span class="meta-nav">&rarr;</span>', 'teaberry');
        previous_posts_link($text);
        ?>
            </div>

        </nav><!-- #<?php 
        echo $html_id;
        ?>
 .navigation -->

    <?php 
    }
}
开发者ID:honeymustard,项目名称:teaberry,代码行数:37,代码来源:page.php

示例15: chivenewengland_content_nav

    /**
     * Displays navigation to next/previous pages when applicable.
     *
     * @since Twenty Twelve 1.0
     */
    function chivenewengland_content_nav($html_id)
    {
        global $wp_query;
        if ($wp_query->max_num_pages > 1) {
            ?>
            <nav id="<?php 
            echo esc_attr($html_id);
            ?>
" class="navigation" role="navigation">
                <ul class="pager">
                    <li class="previous">
                        <?php 
            next_posts_link(__('<i class="fa fa-chevron-left fa-fw"></i> Older', 'chivenewengland'));
            ?>
                    </li>
                    <li class="next">
                        <?php 
            previous_posts_link(__('Newer <i class="fa fa-chevron-right fa-fw"></i>', 'chivenewengland'));
            ?>
                    </li>
                </ul>
            </nav><!-- .navigation -->
        <?php 
        }
    }
开发者ID:alexjustesen,项目名称:chivenewengland,代码行数:30,代码来源:navigation.php


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