本文整理汇总了PHP中posts_nav_link函数的典型用法代码示例。如果您正苦于以下问题:PHP posts_nav_link函数的具体用法?PHP posts_nav_link怎么用?PHP posts_nav_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了posts_nav_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: NextAndPreviousPageLinks
function NextAndPreviousPageLinks()
{
?>
<div class="post-navigation">
<hr />
<?php
posts_nav_link('', 'Newer Posts', 'Older Posts');
?>
</div>
<?php
}
示例2: next_previous_div
function next_previous_div()
{
ob_start();
posts_nav_link();
$links = ob_get_clean();
if (strlen($links) > 0) {
echo '<div class="float post" style="text-align:center">';
echo posts_nav_link();
echo '</div><!-- end post-->';
}
}
示例3: ebor_faq_shortcode
/**
* The Shortcode
*/
function ebor_faq_shortcode($atts)
{
extract(shortcode_atts(array('pppage' => '8', 'filter' => 'all', 'part' => 'excerpt'), $atts));
$query_args = array('post_type' => 'faq', 'posts_per_page' => $pppage);
if (!($filter == 'all')) {
if (function_exists('icl_object_id')) {
$filter = (int) icl_object_id($filter, 'faq_category', true);
}
$query_args['tax_query'] = array(array('taxonomy' => 'faq_category', 'field' => 'id', 'terms' => $filter));
}
$block_query = new WP_Query($query_args);
ob_start();
?>
<div class="row">
<?php
if ($block_query->have_posts()) {
while ($block_query->have_posts()) {
$block_query->the_post();
/**
* Get blog posts by blog layout.
*/
get_template_part('loop/content-faq', $part);
}
} else {
/**
* Display no posts message if none are found.
*/
get_template_part('loop/content', 'none');
}
?>
</div>
<?php
/**
* Post pagination, use ebor_pagination() first and fall back to default
*/
echo function_exists('ebor_pagination') ? ebor_pagination() : posts_nav_link();
?>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例4: theme_pagination
function theme_pagination($pages = '', $range = 1, $style = false)
{
$showitems = 2;
global $paged;
if (empty($paged)) {
$paged = 1;
}
if ($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
echo '<aside class="pagination ' . ($style ? $style : "") . '"><ul>';
if ($paged > 1 && $showitems < $pages) {
echo '<li class="prev"><a href="' . get_pagenum_link($paged - 1) . '">' . ($style == 'style2' ? __('PREV', THB_THEME_NAME) : __('<i class="icon-budicon-439"></i>', THB_THEME_NAME)) . '</a></li>';
}
for ($i = 1; $i <= $pages; $i++) {
if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {
echo $paged == $i ? "<li><span class='current'>" . $i . "</span></li>" : "<li class='pages " . ($i == 1 ? 'first' : '') . "'><a href='" . get_pagenum_link($i) . "'>" . $i . "</a></li>";
}
}
if ($paged < $pages && $showitems < $pages) {
echo '<li class="next"><a href="' . get_pagenum_link($paged + 1) . '">' . ($style == 'style2' ? __('NEXT', THB_THEME_NAME) : __('<i class="icon-budicon-447"></i>', THB_THEME_NAME)) . '</a></li>';
}
// echo '</ul><div class="six mobile-two columns"><span class="pages">'.$paged.' of '.$pages.'</span></div></aside>';
}
if (1 == 2) {
paginate_links();
posts_nav_link();
next_posts_link();
previous_posts_link();
}
}
示例5: theme_pagination
function theme_pagination($pages = '', $range = 1, $style = false)
{
$showitems = 2;
global $paged;
if (empty($paged)) {
$paged = 1;
}
if ($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
echo '<aside class="pagination ' . ($style ? $style : "") . '">';
if ($paged > 1 && $showitems < $pages) {
echo '<a href="' . get_pagenum_link($paged - 1) . '" class="prev page-numbers">' . __('<i class="fa fa-caret-left"></i> PREV', THB_THEME_NAME) . '</a>';
}
for ($i = 1; $i <= $pages; $i++) {
if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {
echo $paged == $i ? "<span class='page-numbers current'>" . $i . "</span></li>" : "<a href='" . get_pagenum_link($i) . "' class='page-numbers'>" . $i . "</a>";
}
}
if ($paged < $pages && $showitems < $pages) {
echo '<a href="' . get_pagenum_link($paged + 1) . '" class="next page-numbers"><span>' . __('NEXT <i class="fa fa-caret-right"></i>', THB_THEME_NAME) . '</span></a>';
}
echo '</aside>';
}
if (1 == 2) {
paginate_links();
posts_nav_link();
next_posts_link();
previous_posts_link();
}
}
示例6: wp_pagenavi
}
?>
<?php
if (function_exists('wp_pagenavi')) {
?>
<?php
wp_pagenavi();
?>
<?php
} else {
?>
<div class="post-navigation"><p><?php
posts_nav_link('∞', '«« Previous Posts', 'Older Posts »»');
?>
</p></div>
<?php
}
?>
</section><!-- end #post-content -->
<?php
get_sidebar();
?>
</div><!-- end .sixteen columns -->
</div><!-- end .container -->
示例7: while
while (have_posts()) {
the_post();
/**
* Get blog posts by blog layout.
*/
get_template_part('loop/content', 'post');
}
} else {
/**
* Display no posts message if none are found.
*/
get_template_part('loop/content', 'none');
}
?>
</div>
<?php
/**
* Post pagination, use ebor_pagination() first and fall back to default
*/
echo function_exists('ebor_pagination') ? ebor_pagination() : posts_nav_link();
?>
</div>
<?php
get_sidebar();
?>
</div>
示例8: posts_nav_link
</div>
<?php
}
?>
<div class="navigation">
<?php
posts_nav_link('', '', '« Previous Entries');
?>
<?php
posts_nav_link('', 'Next Entries »', '');
?>
</div>
<?php
} else {
?>
<h2>Not Found</h2>
<p><?php
_e("Sorry, but you are looking for something that isn't here.");
?>
</p>
<?php
示例9: _e
?>
-->
<?php
}
} else {
?>
<p><?php
_e('Sorry, no posts matched your criteria.');
?>
</p><?php
}
?>
<?php
posts_nav_link(' — ', __('« go back'), __('keep looking »'));
?>
</div>
<?php
include TEMPLATEPATH . "/l_sidebar.php";
?>
<?php
include TEMPLATEPATH . "/r_sidebar.php";
?>
</div>
<!-- The main column ends -->
示例10: edit_post_link
</div>
<p class="postfeedback">
<?php
edit_post_link(__('Edit'), ' {', '}');
?>
</p>
</div>
<?php
}
?>
<?php
posts_nav_link(' · ', __('Next entries »'), __('« Previous entries'));
?>
<?php
} else {
?>
<h2><?php
_e('Not Found');
?>
</h2>
<p><?php
_e('Sorry, but the page you requested cannot be found.');
?>
</p>
示例11: the_post_thumbnail
//вывод ссылки
?>
"><?php
the_post_thumbnail();
//вывод миниатюры
?>
</a>
</div>
<?php
}
?>
<?php
} else {
?>
<?php
}
?>
<div class="clear"><?php
posts_nav_link('<span> - </span>');
//постраничная навигация
?>
</div><!-- сбросить оптикание .clear{clear:both; -->
</div>
<?php
get_sidebar();
?>
</div>
</div>
<?php
get_footer();
示例12: _e
?>
</ul>
<?php
} else {
?>
<div class="no-posts">
<h3><?php
_e('No posts found!', 'p2');
?>
</h3>
</div>
<?php
}
?>
<div class="navigation">
<p><?php
posts_nav_link(' | ', __('← Newer Posts', 'p2'), __('Older Posts →', 'p2'));
?>
</p>
</div>
</div> <!-- main -->
</div> <!-- sleeve -->
<?php
get_footer();
示例13: wp_link_pages
if (is_single()) {
wp_link_pages();
}
?>
<?php
comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
?>
</div>
</div>
</div>
<?php
comments_template();
// Get wp-comments.php template
?>
<?php
}
}
?>
<div class="alignleft"><?php
posts_nav_link('', __('« Newer Posts'), '');
?>
</div>
<div class="alignright"><?php
posts_nav_link('', '', __('Older Posts »'));
?>
</div>
</div>
<?php
get_footer();
示例14: the_excerpt
<?php
the_excerpt();
?>
<p><a href="<?php
echo get_permalink();
?>
">Read More →</a></p><div class="clear"></div><div class="sep"></div>
<?php
}
?>
<?php
} else {
?>
<p><?php
_e("Sorry, no posts matched your criteria.", "arclite");
?>
</p>
<?php
}
?>
<div class="navigation">
<div class="alignleft"><?php
posts_nav_link('$sep', $prelabel, $nextlabel);
?>
</div>
</div>
</div>
<?php
get_sidebar();
get_footer();
示例15: the_excerpt
?>
</a></h3>
<?php
the_excerpt();
?>
</li>
<?php
}
?>
</ol>
</article>
<nav>
<p><?php
posts_nav_link(' • ');
?>
</p>
</nav>
<?php
} else {
?>
<article>
<h1>Not Found</h1>
<p>Sorry, but the requested resource was not found on this site.</p>
<?php
get_search_form();
?>
</article>