Closed mhulse closed 10 years ago
A few different styles to account for:
PHP:
<?php if ($wp_query->max_num_pages > 1): ?> <?php $pagination = paginate_links(array( 'type' => 'array', 'base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))), // Make sure the numbers match. 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages, 'prev_next' => FALSE )); ?> <div class="split"> <p class="split-first pointer"><?php previous_posts_link('« Newer'); ?></p> <p class="split-middle note Aoff Boff"> <?php foreach($pagination as $key => $value): ?> <?=$value?> <?php endforeach; ?> </p> <p class="split-last pointer"><?php next_posts_link('Older »'); ?></p> </div> <!-- /.split --> <hr class="Aon Bon"> <?php endif; ?>
Markup:
<div class="split"> <p class="split-first pointer"><a href="#" >« Newer</a></p> <p class="split-middle note Aoff Boff"> <a class='page-numbers' href='http://blogs.registerguard.com/oregon-football/page/1/'>1</a> <span class='page-numbers current'>2</span> <a class='page-numbers' href='http://blogs.registerguard.com/oregon-football/page/3/'>3</a> <a class='page-numbers' href='http://blogs.registerguard.com/oregon-football/page/4/'>4</a> <span class="page-numbers dots">…</span> <a class='page-numbers' href='http://blogs.registerguard.com/oregon-football/page/271/'>271</a> </p> <p class="split-last pointer"><a href="http://blogs.registerguard.com/oregon-football/page/3/" >Older »</a></p> </div> <!-- /.split -->
... and:
<?php $older = get_adjacent_post(); $newer = get_adjacent_post(NULL, NULL, FALSE); ?> <?php if ($newer || $older): ?> <hr> <div class="w_row"> <div class="w_col w_C130 Aoff Boff"> </div> <div class="w_col w_C640 w_D980"> <div class="split" style="margin-bottom:0"> <?php if ($newer): ?> <p class="split-first pointer"><a href="<?=get_permalink($newer->ID)?>" rel="prev">« Newer</a></p> <?php endif; ?> <?php if ($older): ?> <p class="split-last pointer"><a href="<?=get_permalink($older->ID)?>" rel="next">Older »</a></p> <?php endif; ?> </div> <!-- /.split --> </div> <!-- /.w_col --> <div class="w_col w_C130 Aoff Boff"> </div> </div> <!-- /.w_row --> <?php endif; ?>
<div class="split" style="margin-bottom:0"> <p class="split-first pointer"><a href="http://blogs.registerguard.com/oregon-football/utes-spoil-perfect-week-a-quick-recap-of-saturdays-pac-12-predictions/" rel="prev">« Newer</a></p> <p class="split-last pointer"><a href="http://blogs.registerguard.com/oregon-football/fourth-quarter-oregon-55-wsu-24/" rel="next">Older »</a></p> </div> <!-- /.split -->
Here's the CSS:
.split { *zoom: 1; } .split:before, .split:after { content: " "; display: table; } .split:after { clear: both; } .split { position: relative; margin-bottom: 10px; } .split .split-middle { text-align: center; width: 100%; position: absolute; z-index: 5; } .split .split-first, .split .split-last { display: inline; position: relative; z-index: 10; } .split .split-first { float: left; } .split .split-last { float: right; } .pointer { font: bold .875em/1.71428571428571 Arial, sans-serif; text-transform: uppercase; color: #000; margin: 0; padding: 0; } .pointer a { color: #000; text-decoration: none; } .pointer a:visited { color: #000; } .pointer a:visited:hover, .pointer a:focus, .pointer a:focus:hover, .pointer a:hover, .pointer a:active { color: #ae1a1f; } .note { font: bold 1em/1 Cambria, Georgia, serif; }
That's just an example. A good starting point at least.
Not satisfied, re-opening. YouTube's prev/next ain't bad:
Google mobile is nice:
Another example on Amazon:
Disqus:
http://help.disqus.com/customer/portal/topics/107054-developers/articles?page=2
A few different styles to account for:
PHP:
Markup:
... and:
PHP:
Markup:
Here's the CSS:
That's just an example. A good starting point at least.