Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_loop() {
- global $paged;
- $args = array('post_type' => 'PostType');
- $parentCatID = '114';
- $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);
- while(have_posts()): the_post(); $do_not_duplicate = $post->ID; ?>
- <!-- POST CODE -->
- <div class="post">
- <?php if(has_post_thumbnail()) : ?>
- <?php
- $thumbnail_id=get_the_post_thumbnail($post->ID);
- preg_match ('/src="(.*)" class/',$thumbnail_id,$link);
- $str = get_bloginfo('stylesheet_directory') . '/timthumb/timthumb.php?src=' . $link[1] . '&h=90&w=146&zc=1';
- ?>
- <a class="test" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
- <img src="<?php echo $str ?>" />
- </a>
- <h3><?php echo the_title(); ?></h3>
- <?php endif; ?>
- </div>
- <!-- END POST CODE -->
- <?php
- endwhile;
- echo '<br style="clear:both;" />';
- wp_reset_query();
- }
- endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement