Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Projects
  4. */
  5. ?>
  6.  
  7. <?php get_header() ?>
  8.  
  9. <div id="content">
  10.  
  11. <div id="left">
  12.  
  13. <?php the_post() ?>
  14. <div id="post-<?php the_ID(); ?>" class="post">
  15. <div class="post-content">
  16. <?php the_content() ?>
  17. </div>
  18. </div><!-- .post -->
  19.  
  20. </div>
  21.  
  22. <div id="right">
  23. <ul>
  24. <?php // cycle through categories, print 1 post for each category
  25. $categories=get_categories('taxonomy=project-types&orderby=name&order=ASC&hide_empty=0');
  26. foreach($categories as $category) {
  27. $posts=get_posts('showposts=1&cat='. $category->term_id);
  28. if ($posts) {
  29. 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>';
  30. foreach($posts as $post) {
  31. setup_postdata($post); ?>
  32. <div id="homethumb">
  33. <div class="inside">
  34. <?php the_post_thumbnail(); ?>
  35. </div>
  36. </div>
  37. <?php
  38. } // foreach($posts
  39. } // if ($posts
  40. } // foreach($categories
  41. ?>
  42. </ul>
  43. </div>
  44.  
  45. </div><!-- #content -->
  46.  
  47. <?php get_sidebar() ?>
  48. <?php get_footer() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement