Advertisement
freakyfu

Custom Attachment Page for images

Jan 30th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.00 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <section class="content">
  4.    
  5.     <?php get_template_part('inc/page-title'); ?>
  6.    
  7.     <div class="pad group">
  8.        
  9.         <?php while ( have_posts() ): the_post(); ?>
  10.             <article <?php post_class(); ?>>   
  11.                 <div class="post-inner group">
  12.                    
  13. <?php echo wp_get_attachment_image( get_the_ID(), 'large' ); ?>
  14.  
  15. <h1 class="post-title"><?php the_title(); ?></h1>
  16.  
  17.  
  18. <div class="entry">
  19.     <div class="entry-inner">
  20.         <?php the_content(); ?>
  21.  
  22.         <p class='resolutions'> Downloads:
  23.         <?php
  24.             $images = array();
  25.             $image_sizes = get_intermediate_image_sizes();
  26.             array_unshift( $image_sizes, 'full' );
  27.             foreach( $image_sizes as $image_size ) {
  28.                 $image = wp_get_attachment_image_src( get_the_ID(), $image_size );
  29.                 $name = $image_size . ' (' . $image[1] . 'x' . $image[2] . ')';
  30.                 $images[] = '<a href="' . $image[0] . '">' . $name . '</a>';
  31.             }
  32.  
  33.             echo implode( ' | ', $images );
  34.         ?>
  35.         </p>
  36.     </div>
  37.     <div class="clear"></div>              
  38. </div><!--/.entry-->
  39.                    
  40.                 </div><!--/.post-inner-->  
  41.             </article><!--/.post-->            
  42.         <?php endwhile; ?>
  43.        
  44.         <div class="clear"></div>
  45.        
  46.         <?php the_tags('<p class="post-tags"><span>'.__('Tags:','hueman').'</span> ','','</p>'); ?>
  47.        
  48.         <?php if ( ( ot_get_option( 'author-bio' ) != 'off' ) && get_the_author_meta( 'description' ) ): ?>
  49.             <div class="author-bio">
  50.                 <div class="bio-avatar"><?php echo get_avatar(get_the_author_meta('user_email'),'128'); ?></div>
  51.                 <p class="bio-name"><?php the_author_meta('display_name'); ?></p>
  52.                 <p class="bio-desc"><?php the_author_meta('description'); ?></p>
  53.                 <div class="clear"></div>
  54.             </div>
  55.         <?php endif; ?>
  56.        
  57.         <?php if ( ot_get_option( 'post-nav' ) == 'content') { get_template_part('inc/post-nav'); } ?>
  58.        
  59.         <?php if ( ot_get_option( 'related-posts' ) != '1' ) { get_template_part('inc/related-posts'); } ?>
  60.        
  61.         <?php comments_template('/comments.php',true); ?>
  62.        
  63.     </div><!--/.pad-->
  64.    
  65. </section><!--/.content-->
  66.  
  67. <?php get_sidebar(); ?>
  68.  
  69. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement