Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php while ( have_posts() ) : the_post(); ?>
- <?php
- $parentCatName = single_cat_title('',false);
- $parentCatID = get_cat_ID($parentCatName);
- $childCats = get_categories( 'child_of='.$parentCatID );
- if(is_array($childCats)):
- foreach($childCats as $child){ ?>
- <h2><?php echo $child->name; ?></h2>
- <?php query_posts('cat='.$child->term_id); ?>
- <?php if (strtotime($post->post_date) > strtotime('-4 days')) {
- $newpost='<span class="red">NEW!</span>';
- }
- else {
- $newpost='';
- }
- ?>
- <?php
- /* Include the Post-Format-specific template for the content.
- * If you want to overload this in a child theme then include a file
- * called content-___.php (where ___ is the Post Format name) and that will be used instead.
- */
- $txt1='<p><a href="';
- $txt2= get_permalink();
- $txt3='">';
- $txt4= get_the_title();
- $txt5="</a> (";
- $txt6= $field = get_field('video_time');
- $txt7= ") ";
- $txt8= $newpost;
- $txt9="</p>";
- echo $txt1 . $txt2 . $txt3 . $txt4 . $txt5 . $txt6 . $txt7 . $txt8 . $txt9;
- ?>
- <?php wp_reset_query(); } endif; endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement