Advertisement
Guest User

defaultindex.php

a guest
Jun 20th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.52 KB | None | 0 0
  1. <?php if (!is_search()) { ?>
  2.  
  3.     <?php if (is_category()) { ?>
  4.         <span class="current-category">
  5.             <?php single_cat_title(__('Currently Browsing: ','Influx'), 'display'); ?>
  6.         </span>
  7.     <?php }; ?>
  8.  
  9.     <?php if (is_archive()) $post_number = get_option('influx_archivenum_posts');
  10.         if (is_tag()) $post_number = get_option('influx_tagnum_posts');
  11.         if (is_category()) $post_number = get_option('influx_catnum_posts');
  12.         global $query_string; query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?>
  13.        
  14. <?php } else { ?>
  15.  
  16.     <?php
  17.         $post_number = get_option('influx_searchnum_posts');
  18.         global $query_string;
  19.  
  20.         parse_str($query_string, $qstring_array);
  21.                    
  22.         $args = array('showposts' => $post_number,'paged'=>$paged);
  23.        
  24.         if ( isset($_GET['et_searchform_submit']) ) {          
  25.             $postTypes = array();
  26.             if ( !isset($_GET['et-inc-posts']) && !isset($_GET['et-inc-pages']) ) $postTypes = array('post');
  27.             if ( isset($_GET['et-inc-pages']) ) $postTypes = array('page');
  28.             if ( isset($_GET['et-inc-posts']) ) $postTypes[] = 'post';
  29.             $args['post_type'] = $postTypes;
  30.            
  31.             if ( $_GET['et-month-choice'] != 'no-choice' ) {
  32.                 $et_year = substr($_GET['et-month-choice'],0,4);
  33.                 $et_month = substr($_GET['et-month-choice'], 4, strlen($_GET['et-month-choice'])-4);
  34.                 $args['year'] = $et_year;
  35.                 $args['monthnum'] = $et_month;
  36.             }
  37.            
  38.             if ( $_GET['et-cat'] != 0 )
  39.                 $args['cat'] = $_GET['et-cat'];
  40.         }  
  41.        
  42.         $args = array_merge($args,$qstring_array);
  43.                    
  44.         query_posts($args);
  45.     ?>
  46.  
  47. <?php } ?> 
  48. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  49.     <?php $thumb = '';       
  50.           $width = 575;
  51.           $height = 400;
  52.           $classtext = 'no_border';
  53.           $titletext = get_the_title();
  54.        
  55.           $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
  56.           $thumb = $thumbnail["thumb"]; ?>
  57.  
  58.     <div class="home-post-wrap2">
  59.         <div style="clear: both;"></div>
  60.         <div class="single-entry">
  61.             <?php include(TEMPLATEPATH . '/includes/postinfo.php'); ?>
  62.             <h2 class="titles2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
  63.                 <?php the_title() ?>
  64.                 </a></h2>
  65.             <div style="clear: both;"></div>
  66.            
  67.             <!--Display thumbnail if found-->
  68.             <?php if($thumb != '') { ?>
  69.                 <div class="thumbnail-div-3">
  70.                     <a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>">
  71.                         <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
  72.                     </a>
  73.                 </div>
  74.             <?php }; ?>
  75.            
  76.             <?php truncate_post(310) ?>
  77.             <div style="clear: both;"></div>
  78.            
  79.             <div class="readmore">
  80.                 <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','Influx'), get_the_title()) ?>"><?php _e('Download','Influx'); ?></a>
  81.             </div>
  82.         </div>
  83.     </div>
  84. <?php endwhile; ?>
  85.     <div style="clear: both;"></div>
  86.     <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
  87.               else include(TEMPLATEPATH . '/includes/navigation.php'); ?>
  88. <br/>
  89. <div>
  90. <script type="text/javascript"><!--
  91. google_ad_client = "ca-pub-0554997310851369";
  92. /* paper backgrounds pagenav */
  93. google_ad_slot = "8306474146";
  94. google_ad_width = 468;
  95. google_ad_height = 15;
  96. //-->
  97. </script>
  98. <script type="text/javascript"
  99. src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  100. </script>
  101. </div>
  102. <br/>
  103. <?php else : ?>
  104.     <?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
  105. <?php endif; wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement