Advertisement
Guest User

category.php (media categories)

a guest
Dec 19th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  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. <?php while ( have_posts() ) : the_post();
  19.  
  20. if(!is_category('post-category')) {
  21.  
  22. if(is_category('landscape-2')) { ?>
  23.  
  24. <?php
  25. $args = array(
  26. 'post_type' => 'attachment',
  27. 'numberposts' => -1,
  28. 'post_status' => null,
  29. 'post_parent' => $post->ID,
  30. 'cat' => 15
  31. );
  32.  
  33. }
  34.  
  35. if(is_category('botanical-2')) {
  36.  
  37. $args = array(
  38. 'post_type' => 'attachment',
  39. 'numberposts' => -1,
  40. 'post_status' => null,
  41. 'post_parent' => $post->ID,
  42. 'cat' => 14
  43. );
  44.  
  45. }
  46.  
  47.  
  48. $attachments = get_posts($args);
  49. if ($attachments) {
  50. foreach ( $attachments as $attachment ) {
  51. echo apply_filters(
  52. 'the_title' , $attachment->post_title );
  53. echo '</br>';
  54.  
  55. the_attachment_link( $attachment->ID , false );
  56.  
  57. ?>
  58.  
  59. <p>From the entry:
  60. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
  61.  
  62. </br>
  63. By:
  64. <?php the_author_posts_link();?></p>
  65. </br>
  66.  
  67. <?php
  68. }
  69. }
  70. }
  71. ?>
  72.  
  73. <?php endwhile;?>
  74.  
  75.  
  76. <?php if(is_category('post-category')) {
  77. get_template_part( 'loop', 'category' );
  78.  
  79. }?>
  80.  
  81.  
  82.  
  83. </div><!-- #content -->
  84. </div><!-- #container -->
  85.  
  86. <?php get_sidebar(); ?>
  87. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement