Advertisement
Guest User

index.php

a guest
Dec 10th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <script type="text/javascript" charset="utf-8">
  4. $(document).ready(function() {
  5. $('.home_post_cont img').hover_caption();
  6. // $('.home_small_post_box img').hover_caption();
  7. // $('.side_box img').hover_caption();
  8. });
  9. </script>
  10.  
  11. <div id="content">
  12.  
  13. <div id="content_inside">
  14.  
  15. <?php
  16. $category_ID = get_category_id('blog');
  17.  
  18. if (ereg('iPhone',$_SERVER['HTTP_USER_AGENT'])) {
  19.  
  20. $args = array(
  21. 'post_type' => 'post',
  22. 'posts_per_page' => -1,
  23. 'cat' => '-' . $category_ID,
  24. 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
  25. );
  26.  
  27. } else {
  28.  
  29. $args = array(
  30. 'post_type' => 'post',
  31. 'posts_per_page' => 12,
  32. 'cat' => '-' . $category_ID,
  33. 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
  34. );
  35.  
  36. }
  37.  
  38. query_posts($args);
  39. $x = 0;
  40. while (have_posts()) : the_post(); ?>
  41.  
  42. <?php
  43. $cat_text = '';
  44. foreach((get_the_category()) as $category) {
  45. if($cat_text != '')
  46. $cat_text .= ' / ';
  47.  
  48. $cat_text .= '<a href="' . get_category_link($category->term_id ) . '">' . $category->cat_name . '</a>';
  49. }
  50.  
  51. ?>
  52.  
  53. <?php if($x == 3) { ?>
  54. <div class="home_post_cont home_post_cont_last post_box">
  55. <?php } else { ?>
  56. <div class="home_post_cont post_box">
  57. <?php } ?>
  58. <?php $temp_content = explode(" ",substr(strip_tags(get_the_content()),0,175)); $temp_content[(count($temp_content)-1)] = ''; $new_content = implode(" ",$temp_content); ?>
  59. <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post',array('alt' => 'post image', 'class' => '', 'title' => '<div class="home_post_content"><div class="in_title">' . get_the_title() . '</div><p>' . $new_content . '...</p></div><div class="home_post_cat">' . $cat_text . '</div>')); ?></a>
  60. </div><!--//home_post_cont-->
  61.  
  62. <?php if($x == 3) { $x = -1; echo '<div class="clear"></div>'; } ?>
  63.  
  64. <?php $x++; ?>
  65. <?php endwhile; ?>
  66.  
  67. <div class="clear"></div>
  68.  
  69. </div><!--//content_inside-->
  70.  
  71. <div class="clear"></div>
  72. <div class="load_more_cont">
  73. <div align="center"><div class="load_more_text">
  74.  
  75. <?php
  76.  
  77. ob_start();
  78. next_posts_link('<img src="' . get_bloginfo('stylesheet_directory') . '/images/loading-button.png" />');
  79. $buffer = ob_get_contents();
  80. ob_end_clean();
  81. if(!empty($buffer)) echo $buffer;
  82. ?>
  83.  
  84. </div></div>
  85. </div><!--//load_more_cont-->
  86.  
  87. <?php wp_reset_query(); ?>
  88.  
  89. </div><!--//content-->
  90.  
  91. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement