Advertisement
0bserver

wordpress blog view snippet

Jun 22nd, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.67 KB | None | 0 0
  1.                 <!-- Main Column -->
  2.         <div id="maincolHomePages">
  3.            &nbsp
  4.         <!--TextBox-->
  5.         <div class="textBoxHomePages">
  6.            
  7.             <div class="featuredTopBox">
  8.                 <div class="imgFeatureBoxImg">
  9.                 <div class="imgFeatureBoxImgText1"> Featured Text</div>
  10.                 </div>
  11.             <?php
  12.                 /* Get all sticky posts */
  13.                 $sticky = get_option( 'sticky_posts' );
  14.            
  15.                 /* Sort the stickies with the newest ones at the top */
  16.                 rsort( $sticky );
  17.                 /* Get the 2 newest stickies (change 2 for a different number) */
  18.                 $sticky = array_slice( $sticky, 0, 1 );
  19.                 /* Query sticky posts */
  20.             query_posts( array( 'post__in' => $sticky,'category' => 'watch','caller_get_posts' => 1 ) );
  21.             ?>
  22.             <?php while (have_posts()) : the_post(); ?>
  23.            
  24.            
  25.             <div class="imgFet">   
  26.             <div > <?php the_post_thumbnail('homepage-thumb'); ?> </div>
  27.             </div>
  28.             <div class="textBoxcaption">       
  29.                 <div class="imgFeatureBoxImgText2">    
  30.                 <h2><?php the_title(); ?></h2> 
  31.                 <?php the_excerpt(); ?>
  32.                 <h3><a href=" <?php the_permalink(); ?>" > ReadMore</a></h3>
  33.                 </div> 
  34.             </div>
  35.             <?php endwhile; ?>
  36.             </div>
  37.             <table class="wrapperBoxes">
  38.                 <tr>
  39.                     <td>
  40.                         <p>Search</p>
  41.                     </td>
  42.                 </tr>
  43.                 <tr>
  44.                     <td>
  45.                         <hr class="singlePagesHR">
  46.                     </td>
  47.                 </tr>
  48.                 <tr>
  49.             <?php
  50.             $args = array( 'posts_per_page' => 1, 'order'=> 'DESC','category' => 'watch', 'orderby' => 'post_date','offset' => 0 );
  51.             $postslist = get_posts( $args );
  52.             foreach ($postslist as $post) :  setup_postdata($post); ?>  
  53.             <td class="leftBoxes">
  54.             <div class="imgMargin"> <?php the_post_thumbnail(); ?> </div>
  55.            <br>
  56.             <div class="boxScrollsBlogsView">
  57.             <h2><?php the_title(); ?> </h2>
  58.             <P>
  59.             <?php the_excerpt(); ?>
  60.             </P>
  61.             <h3><a href="<?php the_permalink(); ?>"> ReadMore</a></h3>
  62.             </div>
  63.             </td>
  64.             <?php endforeach; ?>
  65.             <?php
  66.             $args = array( 'posts_per_page' => 1, 'order'=> 'DESC','category' => 'watch', 'orderby' => 'post_date','offset' => 1 );
  67.             $postslist = get_posts( $args );
  68.             foreach ($postslist as $post) :  setup_postdata($post); ?>
  69.             <td class="rightBoxes">    
  70.         <div class="imgMargin"> <?php the_post_thumbnail(); ?> </div>
  71.            <br>
  72.             <div class="boxScrollsBlogsView">
  73.             <h2><?php the_title(); ?> </h2>
  74.             <P>
  75.             <?php the_excerpt(); ?>
  76.             </P>
  77.             <h3><a href="<?php the_permalink(); ?>"> ReadMore</a></h3>
  78.             </div>
  79.             </td>
  80.             <?php endforeach; ?>   
  81.                 </tr>
  82.                 <tr>
  83.             <?php
  84.             $args = array( 'posts_per_page' => 1, 'order'=> 'DESC','category' => 'watch', 'orderby' => 'post_date','offset' => 2 );
  85.             $postslist = get_posts( $args );
  86.             foreach ($postslist as $post) :  setup_postdata($post); ?>  
  87.             <td class="leftBoxes">
  88.             <div class="imgMargin"> <?php the_post_thumbnail(); ?> </div>
  89.            <br>
  90.             <div class="boxScrollsBlogsView">
  91.             <h2><?php the_title(); ?> </h2>
  92.             <P>
  93.             <?php the_excerpt(); ?>
  94.             </P>
  95.             <h3><a href="<?php the_permalink(); ?>"> ReadMore</a></h3>
  96.             </div>
  97.             </td>
  98.             <?php endforeach; ?>           
  99.             <?php
  100.             $args = array( 'posts_per_page' => 1, 'order'=> 'DESC','category' => 'watch', 'orderby' => 'post_date','offset' => 3 );
  101.             $postslist = get_posts( $args );
  102.             foreach ($postslist as $post) :  setup_postdata($post); ?>  
  103.             <td class="rightBoxes">    
  104.         <div class="imgMargin"> <?php the_post_thumbnail(); ?> </div>
  105.            <br>
  106.             <div class="boxScrollsBlogsView">
  107.             <h2><?php the_title(); ?> </h2>
  108.             <P>
  109.             <?php the_excerpt(); ?>
  110.             </P>
  111.             <h3><a href="<?php the_permalink(); ?>"> ReadMore</a></h3>
  112.             </div>
  113.             </td>
  114.             <?php endforeach; ?>
  115.             </tr>
  116.                 <tr>
  117.                     <td>
  118.                         <hr class="singlePagesHR">
  119.                     </td>
  120.                 </tr>
  121.             </table>
  122.         </div>
  123.         </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement