Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // cycle through categories, print 1 post for each category
- $categories=get_categories('orderby=&order=ASC&'); $duplicates = array();
- foreach($categories as $category) {
- $posts=get_posts(array('numberposts' => 1, 'tag' => featured, 'post__not_in' => $duplicates, 'category__in' => array($category->term_id)));
- foreach($posts as $post) {
- setup_postdata($post); $duplicates[] = $post->ID; ?>
- <div class="type-post-date" id="post-<?php the_ID(); ?>" >
- <?php
- $the_cat = get_the_category();
- $category_link = get_category_link( $the_cat[0]->cat_ID );
- ?>
- <div class="cat_name"><a href="<?php echo $category_link; ?>"><?php
- $category = get_the_category();
- echo $category[0]->cat_name;
- ?></a></div>
- <div class="post-home">
- <h2><a href="<?php the_permalink(); ?>" title="<?php printf( __('See %s', 'your-theme'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(thumbnail_small); ?> </a>
- <div class="date_idea_content">
- <?php the_excerpt(); ?>
- </div><!-- .entry-content -->
- </div>
- <div class="date_idea_content_foot">
- <?php
- $the_cat = get_the_category();
- $category_link = get_category_link( $the_cat[0]->cat_ID );
- ?>
- <div class="more_ideas"><a href="<?php echo $category_link; ?>">See More
- <?php
- $category = get_the_category();
- echo $category[0]->cat_name;
- ?></a></div>
- </div>
- </div><!-- #post-<?php the_ID(); ?> -->
- <?php
- } // foreach($posts
- } // foreach($categories
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement