Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Projects
- */
- ?>
- <?php get_header() ?>
- <div id="content">
- <div id="left">
- <?php the_post() ?>
- <div id="post-<?php the_ID(); ?>" class="post">
- <div class="post-content">
- <?php the_content() ?>
- </div>
- </div><!-- .post -->
- </div>
- <div id="right">
- <ul>
- <?php // cycle through categories, print 1 post for each category
- $categories=get_categories('taxonomy=project-types&orderby=name&order=ASC&hide_empty=0');
- foreach($categories as $category) {
- $posts=get_posts('showposts=1&cat='. $category->term_id);
- if ($posts) {
- echo '<li><div style="overflow: hidden;"><h2><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a></h2></div>';
- foreach($posts as $post) {
- setup_postdata($post); ?>
- <div id="homethumb">
- <div class="inside">
- <?php the_post_thumbnail(); ?>
- </div>
- </div>
- <?php
- } // foreach($posts
- } // if ($posts
- } // foreach($categories
- ?>
- </ul>
- </div>
- </div><!-- #content -->
- <?php get_sidebar() ?>
- <?php get_footer() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement