Advertisement
alchymyth

add pagenavi at top

May 2nd, 2011
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.54 KB | None | 0 0
  1. pagenavi to top
  2.  
  3. <?php get_header(); ?>
  4. <?php $options = get_option('blocks2_options'); ?>
  5.  
  6. <?php if ($options['notice'] && $options['notice_content']) : ?>
  7.     <div class="
  8.     <?php if($options['notice_color'] == 1) {echo 'box';}
  9.         else if($options['notice_color'] == 3){echo 'errorbox';}
  10.         else{echo 'messagebox';}
  11.     ?> normalfont">
  12.         <?php echo($options['notice_content']); ?>
  13.     </div>
  14. <?php endif; ?>
  15.  
  16. <?php if (have_posts()) : ?>
  17.  
  18. <div id="pagenavi">
  19.     <?php if(function_exists('wp_pagenavi')) : ?>
  20.         <?php wp_pagenavi() ?>
  21.     <?php else : ?>
  22.         <span class="alignleft floatleft"><?php previous_posts_link(__('&laquo; Newer Entries', 'blocks2')); ?></span>
  23.         <span class="alignright floatright"><?php next_posts_link(__('Older Entries &raquo;', 'blocks2')); ?></span>
  24.     <?php endif; ?>
  25.     <div class="fixed"></div>
  26. </div>
  27.  
  28.     <?php while (have_posts()) : the_post(); update_post_caches($posts); ?>
  29. <div class="post" id="post-<?php the_ID(); ?>">
  30.     <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  31.     <div class="meta">
  32.         <div class="info">
  33.             <?php the_time(__('M jS, Y', 'blocks2')) ?>
  34.             <?php if ($options['author']) : ?>
  35.                  | <?php _e('Posted by ', 'blocks2'); the_author_posts_link(); ?>
  36.             <?php endif; ?>
  37.             <?php if ($options['categories']) : ?>
  38.                  | <?php _e('Filed under ', 'blocks2'); the_category(', '); ?>
  39.             <?php endif; ?>
  40.         </div>
  41.         <div class="comments">
  42.             <?php
  43.                 if (function_exists('the_views')) the_views(true, '', ' | ');
  44.                 comments_popup_link(__('No comments', 'blocks2'), __('1 comment', 'blocks2'), __('% comments', 'blocks2'));
  45.                 edit_post_link(__('Edit', 'blocks2'), ' | ', '');
  46.             ?>
  47.         </div>
  48.         <div class="fixed"></div>
  49.     </div>
  50.  
  51.     <div class="content">
  52.         <?php the_content(__('Read more...', 'blocks2')); ?>
  53.         <div class="fixed"></div>
  54.         <?php if ($options['tags']) : ?>
  55.             <div class="tags"><?php _e('Tags: ', 'blocks2'); the_tags('', ', ', ''); ?></div>
  56.         <?php endif; ?>
  57.     </div>
  58. </div>
  59.     <?php endwhile; ?>
  60.  
  61. <?php else : ?>
  62.     <div class="errorbox">
  63.         <?php _e('Sorry, no posts matched your criteria.', 'blocks2'); ?>
  64.     </div>
  65. <?php endif; ?>
  66.  
  67. <div id="pagenavi">
  68.     <?php if(function_exists('wp_pagenavi')) : ?>
  69.         <?php wp_pagenavi() ?>
  70.     <?php else : ?>
  71.         <span class="alignleft floatleft"><?php previous_posts_link(__('&laquo; Newer Entries', 'blocks2')); ?></span>
  72.         <span class="alignright floatright"><?php next_posts_link(__('Older Entries &raquo;', 'blocks2')); ?></span>
  73.     <?php endif; ?>
  74.     <div class="fixed"></div>
  75. </div>
  76.  
  77. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement