Advertisement
Guest User

category.php (media categories)

a guest
Feb 1st, 2013
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3. * The template for displaying Category Archive pages.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Ten
  7. * @since Twenty Ten 1.0
  8. */
  9.  
  10. get_header(); ?>
  11.  
  12. <div id="container">
  13. <div id="content" role="main">
  14.  
  15. <h1 class="page-title"><?php
  16. printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );?></h1>
  17.  
  18.  
  19.  
  20.  
  21.  
  22. <?php if(is_category('member-entries')) {
  23. get_template_part( 'loop', 'category' );
  24.  
  25. }
  26. if(!is_category('member-entries')) {
  27.  
  28. if(is_category('media-categories')) { ?>
  29.  
  30. <?php
  31. $args = array(
  32. 'post_type' => 'attachment',
  33. 'numberposts' => -1,
  34. 'post_status' => null,
  35. 'post_parent' => $post->ID,
  36. 'cat' => 17
  37. );
  38.  
  39. }
  40.  
  41.  
  42.  
  43.  
  44. if(is_category('landscape-2')) { ?>
  45.  
  46. <?php
  47. $args = array(
  48. 'post_type' => 'attachment',
  49. 'numberposts' => -1,
  50. 'post_status' => null,
  51. 'post_parent' => $post->ID,
  52. 'cat' => 15
  53. );
  54.  
  55. }
  56.  
  57. if(is_category('botanical-2')) {
  58.  
  59. $args = array(
  60. 'post_type' => 'attachment',
  61. 'numberposts' => -1,
  62. 'post_status' => null,
  63. 'post_parent' => $post->ID,
  64. 'cat' => 14
  65. );
  66.  
  67. }
  68.  
  69.  
  70.  
  71.  
  72. $attachments = get_posts($args);
  73.  
  74.  
  75.  
  76. if ($attachments) {
  77.  
  78.  
  79.  
  80. foreach ( $attachments as $attachment ) {
  81.  
  82. echo "<div class='post_class'>\n";
  83. // Start one post
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. $author_id=$attachment->post_author;
  94.  
  95. echo '</br>';
  96.  
  97. echo apply_filters(
  98. 'the_title' , $attachment->post_title );
  99.  
  100. echo '</br>';
  101.  
  102. the_attachment_link( $attachment->ID , false );?>
  103.  
  104. </br>
  105.  
  106. <?php
  107. $curuser = get_userdata($author_id);
  108. $author_post_url=get_author_posts_url($curuser->ID, $curuser->nicename);
  109. echo ' by <a href="' . $author_post_url . '" title="' . sprintf( __( "Posts by %s" ), $curuser->display_name ) . '" ' . '>' . $curuser->display_name.'</a>';?>
  110.  
  111. <p>
  112. From the entry:
  113.  
  114. <a href="<?php echo get_permalink($attachment->post_parent); ?>"><?php echo get_the_title($attachment->post_parent); ?></a>
  115. </p>
  116.  
  117.  
  118. </div><!-- End of post_class -->
  119.  
  120. <?php } ?>
  121.  
  122. <?php } ?>
  123.  
  124. <?php } ?>
  125.  
  126.  
  127.  
  128.  
  129.  
  130. </div><!-- #content -->
  131. </div><!-- #container -->
  132.  
  133. <?php get_sidebar(); ?>
  134. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement