Advertisement
Guest User

index.php to have wide posts at top

a guest
Feb 6th, 2011
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.88 KB | None | 0 0
  1. <?php
  2.  
  3. function render_content() {
  4. global $wp_theme_options;
  5. ?>
  6.         <script type="text/javascript">
  7.             jQuery(document).ready(function() {
  8.                 jQuery(".front-page-thumbnail img").hover(
  9.                     function () {
  10.                         jQuery(this).stop().fadeTo("fast", 0.7);
  11.                     },
  12.                     function () {
  13.                         jQuery(this).stop().fadeTo("fast", 1);
  14.                     }
  15.                 );
  16.             });
  17.         </script>
  18. <?php
  19. $temp = $my_query;
  20. $my_query = new WP_Query();
  21. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  22. $my_query->query('paged='.$paged . '&posts_per_page=' . get_option('posts_per_page'));
  23. $wideposts = 2;
  24. ?> 
  25.     <?php if ( $my_query->have_posts() ) : ?>
  26.         <?php while ( $my_query->have_posts() ) : // The Loop ?>
  27.             <?php $my_query->the_post(); ?>
  28.            
  29.         <?php if ($ct < $wideposts) { ?>
  30.        
  31.             <div class="widecol">              
  32.                 <?php /*the_author_posts_link();*/ ?>
  33.                 <?php /*the_time(__('l, F j, Y', 'Builder'));*/ ?>
  34.                
  35.                 <?php if (has_post_thumbnail()) { ?>
  36.                     <div class="front-page-thumbnail">
  37.                         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'front-page-thumbnail' ); ?></a>
  38.                     </div>
  39.                 <?php } ?>
  40.                
  41.                 <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
  42.                 <div class="post-content">
  43.                     <?php the_excerpt(); ?>
  44.                 </div>
  45.             </div>
  46.        
  47.         <?php  } else {  ?>
  48.            
  49.         <div class="magazine-post" style="width: <?php echo $wp_theme_options["home_width"] ?>px;">
  50.             <?php /*the_author_posts_link();*/ ?>
  51.             <?php /*the_time(__('l, F j, Y', 'Builder'));*/ ?>
  52.            
  53.             <?php if (has_post_thumbnail()) { ?>
  54.             <div class="front-page-thumbnail">
  55.                 <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'front-page-thumbnail' ); ?></a>
  56.             </div>
  57.             <?php } ?>
  58.  
  59.             <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
  60.            
  61.             <!--post text with the read more link -->
  62.             <div class="post-content">
  63.                 <?php the_excerpt(); ?>
  64.             </div>
  65.         </div>
  66.        
  67.         <?php } ?>
  68.  
  69.     <?php $ct++; ?>
  70.    
  71.     <?php endwhile; // end of one post ?>
  72.     <?php $my_query = null; $my_query = $temp;?>
  73.     <!-- Previous/Next page navigation -->
  74.     <div class="paging clearfix">
  75.         <div class="alignleft"><?php previous_posts_link( __( '&larr; Previous Page', 'it-l10n-BuilderChild-Ionic' ) ); ?></div>
  76.         <div class="alignright"><?php next_posts_link( __( 'Next Page &rarr;', 'it-l10n-BuilderChild-Ionic' ) ); ?></div>
  77.     </div>
  78.    
  79.     <?php else : // do not delete ?>
  80.         <?php do_action( 'builder_template_show_not_found' ); ?>
  81.     <?php endif; // do not delete ?>
  82. <?php
  83.    
  84. }
  85.  
  86. add_action( 'builder_layout_engine_render_content', 'render_content' );
  87.  
  88. do_action( 'builder_layout_engine_render', basename( __FILE__ ) );
  89.  
  90.  
  91. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement