Advertisement
Guest User

Untitled

a guest
Dec 14th, 2011
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php while ( have_posts() ) : the_post(); ?>
  2.  
  3. <?php
  4. $parentCatName = single_cat_title('',false);
  5. $parentCatID = get_cat_ID($parentCatName);
  6. $childCats = get_categories( 'child_of='.$parentCatID );
  7. if(is_array($childCats)):
  8. foreach($childCats as $child){ ?>
  9. <h2><?php echo $child->name; ?></h2>
  10. <?php query_posts('cat='.$child->term_id); ?>
  11.  
  12.  
  13.  
  14. <?php if (strtotime($post->post_date) > strtotime('-4 days')) {
  15.  
  16. $newpost='<span class="red">NEW!</span>';
  17.  
  18.  
  19. }
  20.  
  21. else {
  22.  
  23. $newpost='';
  24. }
  25.  
  26. ?>
  27. <?php
  28. /* Include the Post-Format-specific template for the content.
  29. * If you want to overload this in a child theme then include a file
  30. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  31. */
  32. $txt1='<p><a href="';
  33. $txt2= get_permalink();
  34. $txt3='">';
  35. $txt4= get_the_title();
  36. $txt5="</a> (";
  37. $txt6= $field = get_field('video_time');
  38. $txt7= ") ";
  39. $txt8= $newpost;
  40. $txt9="</p>";
  41. echo $txt1 . $txt2 . $txt3 . $txt4 . $txt5 . $txt6 . $txt7 . $txt8 . $txt9;
  42.  
  43. ?>
  44.  
  45. <?php wp_reset_query(); } endif; endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement