rakeshr

infinite scroll in wordpress not working

Mar 18th, 2013
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.57 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php
  3. if ($_GET['cat'] == NULL) {
  4.     $crecurcat = "9";
  5.     } else { $crecurcat = $_GET['cat']; }
  6.  ?>
  7.  
  8.  
  9. <div id="pagecontent">
  10. <div id="crenav">
  11.  
  12. <h1><a href="?cat=" rel="bookmark">All</a></h1>
  13.  
  14. <?php $wpgleftposts = new WP_Query('category_name=credits&orderby=id&order=asc&posts_per_page=1'); ?>
  15.                <?php while ($wpgleftposts->have_posts()) : $wpgleftposts->the_post(); ?>
  16.  
  17. <?php $curpid = $post->ID; ?>
  18.  
  19.                <?php endwhile; ?>
  20.  
  21.  
  22.  
  23.  
  24. <?php
  25. $parentCatName = single_cat_title('',false);
  26. $parentCatID = get_cat_ID($parentCatName);
  27. $childCats = get_categories( 'child_of='.$parentCatID );
  28.  
  29. if(is_array($childCats)):
  30. foreach($childCats as $child){ ?>
  31. <?php $childcatid = get_cat_ID($child->name); ?>
  32. <h1><a href="?cat=<?php echo $childcatid; ?>" rel="bookmark"  <?php if ($crecurcat == $childcatid){echo 'class = "current"';} ?>  title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo $child->name; ?></a></h1>
  33. <?php }
  34. endif;
  35. ?>
  36.  
  37.  
  38. </div>
  39. <div id="crepost">
  40.  <?php if (have_posts()) : ?>
  41.  
  42.  <?php query_posts( array(
  43.      'cat' => $crecurcat,
  44.      'orderby' => 'id',
  45.      'order' => 'asc',
  46. ));
  47. ?>
  48.  
  49.   <?php //$creloop = new WP_Query('category_name=credits&orderby=id&order=asc&paged=$paged'); ?>
  50.                <?php while (have_posts()) : the_post(); ?>
  51. <div class="crepostbox">
  52. <div class="crebcon"><h1><?php the_title(); ?></h1></div>
  53. <?php  the_post_thumbnail('full'); ?>
  54. </div>
  55.                <?php endwhile; ?>
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                
  62.      <?php endif; ?>
  63. </div>
  64. </div>
  65.  
  66.  
  67. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment