Advertisement
kristopherlouie

BAM index.php

Apr 27th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.38 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package WordPress
  4.  * @subpackage BigAssMonsters
  5.  */
  6.  
  7. get_header(); ?>
  8.         <div id="feature">
  9.         <div id="slider">
  10.         <!-- element with overflow applied -->
  11.               <div class="scroll">
  12.               <!-- the element that will be scrolled during the effect -->
  13.                     <div class="scrollContainer">
  14.                     <!-- our individual panels -->
  15.                     <?php
  16.                     $do_not_duplicate = array();
  17.                     $featured_query = new WP_Query('showposts=4&cat=1');
  18.                     while ($featured_query->have_posts()) : $featured_query->the_post();
  19.                         $do_not_duplicate[] = get_the_ID();
  20.                     ?>
  21.                     <?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
  22.                         <article id="post-<?php the_ID(); ?>" <?php post_class('panel'); ?> style="background-image:url('<?php echo $url ?>')">
  23.                         <header class="entry-header">
  24.                         <h2><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  25.                         </article>
  26.                     <?php endwhile;  ?>
  27.                    
  28.                 </div>
  29.             </div>
  30.                
  31.                 <nav>
  32.                     <ul>
  33.                     <?php
  34.                         $postcount = 0;
  35.                         $featured_query = new WP_Query('showposts=4&cat=1');
  36.                         while ($featured_query->have_posts()) : $featured_query->the_post();
  37.                           $do_not_duplicate[] = get_the_ID();
  38.                           $postcount++;
  39.                     ?>
  40.                     <?php if( $postcount == 1 ) : ?>
  41.                         <li><a href="#post-<?php the_ID(); ?>" <?php post_class('selected');?>><?php if (strlen($post->post_title) > 30) { echo substr(the_title($before = '', $after = '', FALSE), 0, 30) . '...'; } else { the_title();} ?></a></li>
  42.                     <?php else : ?>
  43.                         <li><a href="#post-<?php the_ID(); ?>" <?php post_class();?>><?php if (strlen($post->post_title) > 30) { echo substr(the_title($before = '', $after = '', FALSE), 0, 30) . '...'; } else { the_title();} ?></a></li>
  44.                     <?php endif; ?>    
  45.                     <?php endwhile; ?>
  46.                     </ul>
  47.                 </nav>
  48.           </div>
  49.         </div>
  50.            
  51.         <div id="recent-posts">
  52.         <?php
  53.         $args=array(
  54.           'posts_per_page' => 5,
  55.           'post__not_in' => array_merge($do_not_duplicate, get_option( 'sticky_posts' )),
  56.         );
  57.         $featured_query = new WP_Query($args);
  58.             while ($featured_query->have_posts()) : $featured_query->the_post();
  59.             $do_not_duplicate[] = $post->ID; ?>
  60.             <article id="post-<?php the_ID(); ?>" <?php post_class(''); ?>>
  61.                 <div class="entry-date">
  62.                     <p><?php the_time('j'); ?></p>
  63.                     <span><?php the_time('F'); ?></span>
  64.                 </div>
  65.                 <div class="entry">
  66.                     <h3><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title(); ?></a></h3>
  67.                     <?php the_content(); ?>
  68.                 </div>
  69.           </article>
  70.         <?php endwhile; ?>
  71.         </div>
  72.  
  73.         <?php get_sidebar(); ?>
  74.        
  75.         </div> <!--/content-->
  76.     </div> <!--/container-->
  77. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement