Want more features on Pastebin? Sign Up, it's FREE!

Blogpage Template

By: STATEDLIGHT on Jan 21st, 2013  |  syntax: None  |  size: 3.77 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /*
  3. Template Name: Blog
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7.  
  8. <div id="container">
  9.   <div id="content">
  10.     <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
  11.     <div id="nav-above" class="navigation">
  12.       <p class="nav-previous">
  13.         <?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> older articles', 'tiger' )) ?>
  14.       </p>
  15.       <p class="nav-next">
  16.         <?php previous_posts_link(__( 'newer articles <span class="meta-nav">&raquo;</span>', 'tiger' )) ?>
  17.       </p>
  18.     </div>
  19.     <?php } ?>
  20.     <?php
  21. $temp = $wp_query;
  22. $wp_query= null;
  23. $wp_query = new WP_Query();
  24. $tiger_number_posts = get_option('tiger_number_posts');
  25. $wp_query->query('posts_per_page='.$tiger_number_posts.'&paged='.$paged);
  26. while ($wp_query->have_posts()) : $wp_query->the_post();
  27. ?>
  28.     <div id="post-<?php the_ID(); ?>" class='<?php echo (++$j % 2 == 0) ? 'evenpost' : 'oddpost'; ?>'>
  29.     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( __('Read', 'tiger'), the_title_attribute('echo=0') ); ?>" rel="bookmark">
  30.       <?php tiger_truncate_title(20); ?>
  31.       </a></h2>
  32.     <?php $tiger_thumbs_blog = get_option('tiger_thumbs_blog');
  33. if ($tiger_thumbs_blog == "true"): ?>
  34.     <?php if ( has_post_thumbnail() ): $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
  35.     <a href="<?php the_permalink(); ?>" title="<?php printf( __('Read', 'tiger'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_post_thumbnail( 'blog-thumb' ); ?></a>
  36.     <?php else: ?>
  37.     <a href="<?php the_permalink(); ?>" title="<?php printf( __('Read', 'tiger'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><img src="<?php echo get_template_directory_uri(); ?>/images/awaiting-image.jpg" alt="Awaiting image" class="blog-thumb" /></a>
  38.     <?php endif; ?>
  39.     <?php endif; ?>
  40.     <div class="entry-meta"> <span class="meta-prep meta-prep-author">
  41.       <?php _e('By ', 'tiger'); ?>
  42.       </span> <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" title="<?php printf( __( 'View all articles by %s', 'tiger' ), $authordata->display_name ); ?>">
  43.       <?php the_author(); ?>
  44.       </a></span> <span class="meta-sep"> | </span> <span class="meta-prep meta-prep-entry-date">
  45.       <?php _e('Published ', 'tiger'); ?>
  46.       </span> <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>">
  47.       <?php the_time( get_option( 'date_format' ) ); ?>
  48.       </abbr></span>
  49.       <?php edit_post_link( __( 'Edit', 'tiger' ), "<span class=\"meta-sep\"> | </span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
  50.     </div>
  51.     <div class="entry-content">
  52.       <?php $tiger_thumbs_blog = get_option('tiger_thumbs_blog');
  53. if ($tiger_thumbs_blog == "true"): ?>
  54.       <?php tiger_truncate_post(320); ?>
  55.       <?php else: ?>
  56.       <?php tiger_truncate_post(650); ?>
  57.       <?php endif; ?>
  58.     </div>
  59.   </div>
  60.     <?php comments_template(); ?>
  61.     <?php endwhile; ?>
  62.     <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
  63.     <div id="nav-below" class="navigation">
  64.       <?php if(function_exists('wp_pagenavi')) { ?>
  65.       <?php wp_pagenavi(); ?>
  66.       <?php } else { ?>
  67.       <div class="nav-previous">
  68.         <?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> older articles', 'tiger' )) ?>
  69.       </div>
  70.       <div class="nav-next">
  71.         <?php previous_posts_link(__( 'newer articles <span class="meta-nav">&raquo;</span>', 'tiger' )) ?>
  72.       </div>
  73.       <?php }  ?>
  74.     </div>
  75.     <div class="clear-floats"></div>
  76.     <?php } ?>
  77.   </div>
  78. </div>
  79. <div id="sidebar">
  80.   <?php dynamic_sidebar('right'); ?>
  81. </div>
  82. <?php get_footer(); ?>
clone this paste RAW Paste Data