Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * attachment.php
- * The template for displaying all attachment single posts.
- * Custom Attachment page by Fahim Murshed
- * https://fahimm.com
- *
- * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
- *
- * @package Astra
- * @since 1.0.0
- */
- if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly.
- }
- get_header(); ?>
- <?php if ( astra_page_layout() == 'left-sidebar' ) : ?>
- <?php get_sidebar(); ?>
- <?php endif ?>
- <div id="primary" <?php astra_primary_class(); ?>>
- <?php astra_primary_content_top(); ?>
- <h1 class="post-title"><?php the_title(); ?></h1>
- <?php
- echo wp_get_attachment_image( get_the_ID(), 'large' );
- echo "<hr><p class='resolutions'> Downloads: ";
- $images = array();
- $image_sizes = get_intermediate_image_sizes();
- array_unshift( $image_sizes, 'full' );
- foreach( $image_sizes as $image_size ) {
- $image = wp_get_attachment_image_src( get_the_ID(), $image_size );
- $name = $image_size . ' (' . $image[1] . 'x' . $image[2] . ')';
- $images[] = '<a href="' . $image[0] . '">' . $name . '</a>';
- }
- echo implode( ' | ', $images );
- echo "</p>";
- astra_content_loop();
- ?>
- <?php
- ?>
- </p>
- <?php astra_primary_content_bottom(); ?>
- </div><!-- #primary -->
- <?php if ( astra_page_layout() == 'right-sidebar' ) : ?>
- <?php get_sidebar(); ?>
- <?php endif ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement