Permalink
Browse files

修正导航 = = || 主页现实post数量

  • Loading branch information...
udonmai committed Apr 13, 2012
1 parent ce79196 commit 934a59524b9808bc6127cc58c7d26912d711e207
Showing with 16 additions and 19 deletions.
  1. +2 −1 index.php
  2. +4 −12 single.php
  3. +10 −6 tag.php
View
@@ -6,7 +6,8 @@
<div class="section">
<h2>LATEST</h2>
<ul>
- <?php while ( have_posts() ) : the_post() ?>
+ <?php $my_query = new WP_Query('posts_per_page=7');
+ while ( $my_query->have_posts() ) : $my_query->the_post() ?>
<li id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
<span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php unset($previousday); printf( __( '%1$s', 'sandbox' ), the_date( 'D, M d, Y', '', '', false ), get_the_time() ) ?></abbr></span>
View
@@ -21,20 +21,12 @@
</div><!-- .post -->
<div id="nav-below" class="navigation">
- <?
- $ppl = previous_post_link( '%link', '<span class="meta-nav" title="%title">&laquo;Pre</span> ' );
- if($ppl != NULL) {
- ?>
<div class="navi nav-previous">
- <span><?php echo $ppl; ?>&nbsp;</span>
- </div> <? } ?>
- <?
- $npl = next_post_link( '%link', '<span class="meta-nav" title="%title">Nxt&raquo;</span>' );
- if($npl != NULL) {
- ?>
+ <span><?php previous_post_link( '%link', '<span class="meta-nav" title="%title">&laquo;Pre</span> ' )?>&nbsp;</span>
+ </div>
<div class="navi nav-next">
- <span>&nbsp;<?php echo $npl; ?></span>
- </div> <? } ?>
+ <span>&nbsp;<?php next_post_link( '%link', '<span class="meta-nav" title="%title">Nxt&raquo;</span>' )?></span>
+ </div>
</div>
<?php comments_template() ?>
View
16 tag.php
@@ -32,20 +32,24 @@
</div>
<div id="nav-below" class="navigation">
- <?
- $npl = next_posts_link( __( '<span class="meta-nav">&laquo;</span> Older posts', 'sandbox' ) );
+ <?php
+ //$npl = next_posts_link( __( '<span class="meta-nav">&laquo;</span> Older posts', 'sandbox' ) );
+ $npl = get_next_posts_link('Older posts');
if($npl != NULL) {
?>
<div class="btn nav-previous left">
<span>&nbsp;<?php echo $npl; ?></span>
- </div> <? } ?>
- <?
- $ppl = previous_posts_link( __( 'Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox' ) );
+ </div>
+ <?php } ?>
+ <?php
+ //$ppl = get_previous_posts_link( __( 'Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox' ) );
+ $ppl = get_previous_posts_link('Newer posts');
if($ppl != NULL) {
?>
<div class="btn nav-next right">
<span><?php echo $ppl; ?>&nbsp;</span>
- </div><? } ?>
+ </div>
+ <?php } ?>
</div>
</div><!-- #content -->

0 comments on commit 934a595

Please sign in to comment.