Guest User

Untitled

a guest
Apr 29th, 2011
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.95 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <div id="content-wrap">
  4.   <div id="content">
  5.     <div class="gap">
  6.       <?php if ( $paged < 2 ) {  // Do stuff specific to first page  ?>
  7.       <?php if (have_posts()) : ?>
  8.       <?php $my_query = new WP_Query('showposts=1');
  9.   while ($my_query->have_posts()) : $my_query->the_post();
  10.   $do_not_duplicate = $post->ID;?>
  11.       <div class="post lastlast clearfix" id="post-<?php the_ID(); ?>">
  12.         <?php
  13. $id =$post->ID;
  14. $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
  15. $pattern = '!<img.*?src="(.*?)"!';
  16. preg_match_all($pattern, $the_content, $matches);
  17. $image_src = $matches['1'][0];
  18. ?>
  19.         <div class="tumbr" style="z-index:2;margin-left: 10px;float:right; width: 295px; height: 190px; background: url(<?php if($image_src != '') { echo $image_src; } else { ?><?php bloginfo('template_directory'); ?>/images/no-img.gif<?php } ?>) 0 0 no-repeat; content: ".";"> </div>
  20.        
  21.         <div class="superlast clearfix">
  22.         <div class="superdate">
  23.         <span class="catr">
  24.           <?php the_category(', ') ?>
  25.           </span> <span class="timr">
  26.           <?php the_time('F jS, Y') ?>
  27.           </span> <span class="author">by
  28.           <?php the_author_posts_link() ?>
  29.           </span>
  30.         </div>
  31.        
  32.         <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  33.           <?php the_title(); ?>
  34.           </a></h2>
  35.         <div class="entry">
  36.           <?php //the_content_rss('', TRUE, '', 70); ?>
  37.           <?php the_excerpt_rss('Read the rest of this entry &rarr;  '); ?> <?php edit_post_link('e', '<span class="editr">[', ']</span>'); ?>
  38.         </div>
  39.         <div class="metameta"><span class="commr"><?php comments_popup_link('No Comments', 'Comment (1)', 'Comments (%)'); ?></span></div>
  40.      
  41.       </div>
  42.       <br class="clear" />
  43.      
  44.       </div>
  45.       <?php endwhile; ?>
  46.       <div class="superflow">
  47.       <?php
  48.             $counter = 0; $counter2 = 0;
  49.  
  50.      
  51.        if (have_posts()) : while (have_posts()) : the_post();
  52.      
  53.      
  54.       $counter++; $counter2++;
  55.      
  56.   if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
  57.      <div class="posties <?php if ($counter == 1) { echo 'leftside'; } else { echo 'rightside'; $counter = 0; } ?>" id="post-<?php the_ID(); ?>">
  58.        <div class="postmetadata">
  59.        <span class="timr"><?php the_time('d m y') ?></span> &#8226; <span class="catr"><?php the_category(', ') ?>
  60.         </div>  
  61.         <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  62.           <?php the_title(); ?>
  63.           </a></h2>
  64.         <div class="entry">
  65.  
  66.         <p><?php
  67.                         $texter = get_the_excerpt();
  68.                         if(strlen($texter ) > 220) {
  69.                         $texter = substr($texter , 0, 220);
  70.                         }
  71.                         echo ''.$texter.'[...]';
  72.                         ?>
  73.                         </p>
  74.         </div>
  75.         <div class="metameta">
  76.         <span class="more"><a href="<?php the_permalink(); ?>" title="Go to <?php the_title(); ?>">Read more ... &rarr;</a></span>
  77.           <?php edit_post_link('e', '<span class="editr">[', ']</span>'); ?>
  78.           <span class="commr">
  79.           <?php comments_popup_link('No Comments', 'Comment (1)', 'Comments (%)'); ?>
  80.           </span> </div>
  81.       </div>
  82.       <?php endwhile;  endif; ?>
  83.       <br class="clear" />
  84.       <div class="navigation">
  85.         <div class="alignleft">
  86.           <?php next_posts_link('&larr; Previous Entries') ?>
  87.         </div>
  88.         <div class="alignright">
  89.           <?php previous_posts_link('Next Entries &rarr;') ?>
  90.         </div>
  91.       </div>
  92.      
  93.      
  94.      
  95.       <div class="box">
  96.       <?php
  97.             if(get_settings('hamasaki_featuredcats')!='')
  98.         {
  99.             $cats_on_featured = 'cat='. get_settings('hamasaki_featuredcats');
  100.         }  
  101.  
  102.     ?>
  103.                    <div class="featured">
  104.  
  105.  <?php $my_cat = new WP_Query('showposts=1&'.$cats_on_featured); ?>
  106.             <?php while ($my_cat->have_posts()) : $my_cat->the_post(); ?>
  107.             <h3 class="title"><span><?php the_category(', ') ?></span></h3>
  108.         <?php endwhile; ?>
  109.  
  110.  <?php $my_query = new WP_Query('showposts=2&'.$cats_on_featured); ?>
  111.  
  112.             <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  113.  
  114.                 <div class="featured-post" id="post-<?php the_ID(); ?>">
  115.                  <div class="post-content">    
  116.                         <h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  117.                         <p><?php echo strip_tags(get_the_excerpt(), '<a><strong>'); ?></p>
  118.                   </div>
  119.                     <div class="post-image">
  120.                     <?php
  121. $id =$post->ID;
  122. $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
  123. $pattern = '!<img.*?src="(.*?)"!';
  124. preg_match_all($pattern, $the_content, $matches);
  125. $image_src = $matches['1'][0];
  126. ?>
  127.         <div class="tumbr" style="border: 1px solid #333; width: 140px;height: 110px;background: url(<?php if($image_src != '') { echo $image_src; } else { ?><?php bloginfo('template_directory'); ?>/images/no-image.gif<?php } ?>) 0 0 no-repeat;"> </div>
  128.                                        
  129.                     </div>
  130. <br class="clear" />                    
  131.                   <p class="posted"><?php edit_post_link('e', '<span class="editr">[', ']</span>'); ?><span class="comments"><?php comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)'); ?></span></p>
  132.                  
  133.                 </div><!--/post-->
  134.  
  135.         <?php endwhile; ?>
  136.        
  137.             </div><!--/featured_posts-->
  138.                        
  139. </div><!--/box-->
  140.  
  141.      
  142.      
  143.       </div> <!-- /.superflow -->
  144.       <?php else : ?>
  145.       <h2 class="center">Not Found</h2>
  146.       <p class="center">Sorry, but you are looking for something that isn't here.</p>
  147.       <?php include (TEMPLATEPATH . "/searchform.php"); ?>
  148.       <?php endif; ?>
  149.       <?php } else { // Do stuff specific to non-first page ?>
  150.       <?php while (have_posts()) : the_post(); ?>
  151.  
  152.       <div class="post double" id="post-<?php the_ID(); ?>">
  153.        
  154.         <div class="post-image">
  155.                     <?php
  156. $id =$post->ID;
  157. $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
  158. $pattern = '!<img.*?src="(.*?)"!';
  159. preg_match_all($pattern, $the_content, $matches);
  160. $image_src = $matches['1'][0];
  161. ?>
  162.         <div class="tumbr" style="border: 1px solid #333; width: 140px;height: 110px;background: url(<?php if($image_src != '') { echo $image_src; } else { ?><?php bloginfo('template_directory'); ?>/images/no-image.gif<?php } ?>) 0 0 no-repeat;"> </div>
  163.                                        
  164.                     </div>        
  165.      <div class="postin">  
  166.      <div class="postmetadata">
  167.        <span class="timr"><?php the_time('d m y') ?></span> &#8226; <span class="catr"><?php the_category(', ') ?>
  168.         </div>  
  169.  
  170.         <h2><a class="thetip" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  171.           <?php the_title(); ?>
  172.           </a></h2>
  173.         <div class="entry">
  174.           <?php the_excerpt_rss('Read the rest of this entry &rarr;  '); ?> <?php edit_post_link('e', '<span class="editr">[', ']</span>'); ?>
  175.         </div>
  176.         <div class="metameta">
  177.         <span class="tages">
  178.         <?php if(function_exists('the_tags')): the_tags(); endif;?>
  179.         </span>
  180.        
  181.           <span class="commr">
  182.           <?php comments_popup_link('No Comments', 'Comment (1)', 'Comments (%)'); ?>
  183.           </span> </div>
  184.       </div>       </div>
  185.  
  186.       <?php endwhile;  ?>
  187.       <div class="navigation">
  188.         <div class="alignleft">
  189.           <?php next_posts_link('&larr; Previous Entries') ?>
  190.         </div>
  191.         <div class="alignright">
  192.           <?php previous_posts_link('Next Entries &rarr;') ?>
  193.         </div>
  194.       </div>
  195.       <?php } ?>
  196. </div> <!-- /gap -->
  197. </div> <!-- /content -->
  198. </div> <!-- /content-wrap -->
  199.  
  200. <?php get_sidebar(); ?>
  201. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment