Advertisement
Guest User

WordPress Custom Blog Template

a guest
Dec 7th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.99 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <div id="blog" class="container_16">
  3.     <div class="grid_12">
  4.         <?php
  5.             if(!is_paged()){
  6.         ?>
  7.         <div class="intro">
  8.         </div>
  9.         <div class="top posts">
  10.         <?php
  11.            
  12.             query_posts(array('posts_per_page' => 2, 'post_type' => 'post'));
  13.        
  14.             if(have_posts()){
  15.                 while(have_posts()){
  16.                     the_post();
  17.         ?>
  18.             <div class="post">
  19.                 <div class="date">
  20.                     <div class="content">
  21.                         <?php the_time('d M'); ?>, <?php the_time(); ?>
  22.                     </div>
  23.                     <div class="triangle"></div>
  24.                 </div>
  25.                 <div class="thumb">
  26.                     <?php the_post_thumbnail('blog-latest'); ?>
  27.                 </div>
  28.                 <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
  29.                 <?php the_excerpt(); ?>
  30.                 <p><a href="<?php the_permalink(); ?>">Read post &raquo;</a></p>
  31.                 <?php the_tags('<ul class="tags"><li>', '</li><li>', '</li></ul>'); ?>
  32.             </div>
  33.         <?php
  34.                 }
  35.             }
  36.            
  37.             wp_reset_query();
  38.         ?>
  39.         </div>
  40.         <div class="other-posts">
  41.         <?php
  42.             query_posts(array('posts_per_page' => 4, 'offset' => 2));
  43.            
  44.             $i = 1;
  45.            
  46.             if(have_posts()){
  47.                 while(have_posts()){
  48.                     the_post();
  49.                    
  50.                     if(has_post_thumbnail()){
  51.                         $class = 'with-thumb';
  52.                     }else{
  53.                         $class = 'no-thumb';
  54.                     }
  55.         ?>
  56.             <div class="other-post grid_6 <?php if($i == 1 || $i == 3){ ?>alpha <?php }else{ ?>omega <?php } echo $class; ?>">
  57.             <div class="thumb">
  58.                 <?php if(has_post_thumbnail()){ ?>
  59.                     <?php the_post_thumbnail('blog-small'); ?>
  60.                 <?php }else{ ?>
  61.                     <img src="<?php bloginfo('template_url'); ?>/images/placeholders/blog-small.png" />
  62.                 <?php } ?>
  63.             </div>
  64.             <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
  65.             <?php the_time('d M'); ?>, <?php the_time(); ?>
  66.             <?php the_excerpt(); ?>
  67.             <?php the_tags('<ul class="tags"><li>', '</li><li>', '</li></ul>'); ?>
  68.             </div>
  69.         <?php
  70.                     $i++;
  71.                 }
  72.                
  73.                 echo '<div class="navigation"><p>';
  74.                 posts_nav_link();
  75.                 echo '</p></div>';
  76.             }
  77.         ?>
  78.         </div>
  79.         <?php
  80.             }else{
  81.         ?>
  82.             <h2>Bluefly<span>Digital</span> Blog Archive</h2>
  83.         <?php
  84.                 if(have_posts()){
  85.                     while(have_posts()){
  86.                         the_post();
  87.         ?>
  88.             <div class="archive-post">
  89.                 <div class="thumb">
  90.                     <?php if(has_post_thumbnail()){ ?>
  91.                         <?php the_post_thumbnail('blog-small'); ?>
  92.                     <?php }else{ ?>
  93.                         <img src="<?php bloginfo('template_url'); ?>/images/placeholders/blog-small.png" />
  94.                     <?php } ?>
  95.                 </div>
  96.                 <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
  97.                 <?php the_excerpt(); ?>
  98.                 <a href="<?php the_permalink();?>">Read full post &raquo;</a>
  99.                 <?php the_tags('<ul class="tags"><li>', '</li><li>', '</li></ul>'); ?>
  100.                
  101.             </div>
  102.            
  103.         <?php
  104.                     }
  105.                    
  106.                     echo '<div class="navigation"><p>';
  107.                     posts_nav_link();
  108.                     echo '</p></div>';
  109.                 }
  110.            
  111.             }
  112.         ?>
  113.     </div>
  114.     <div class="grid_4">
  115.         <ul class="blog-social">
  116.             <li><a href="#">RSS</a></li>
  117.             <li><a href="#">Twitter</a></li>
  118.         </ul>
  119.     </div>
  120. </div>
  121. <?php get_footer(); ?>
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement