-
Notifications
You must be signed in to change notification settings - Fork 195
/
audio.php
39 lines (31 loc) · 1.53 KB
/
audio.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* The template for displaying audio attachments.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package Odin
* @since 2.2.0
*/
get_header(); ?>
<main id="content" class="<?php echo odin_classes_page_sidebar(); ?>" tabindex="-1" role="main">
<?php while ( have_posts() ) : the_post(); $metadata = wp_get_attachment_metadata(); ?>
<article <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content entry-attachment">
<?php echo wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) ); ?>
<p><strong><?php _e( 'URL:', 'odin' ); ?></strong> <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><span><?php echo esc_html( basename( wp_get_attachment_url() ) ); ?></span></a></p>
<?php the_content(); ?>
<?php if ( ! empty( $post->post_parent ) ) : ?>
<ul class="pager page-title">
<li class="previous"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Back to %s', 'odin' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>"><?php printf( __( '<span class="meta-nav">←</span> %s', 'odin' ), get_the_title( $post->post_parent ) ); ?></a></li>
</ul><!-- .pager -->
<?php endif; ?>
</div><!-- .entry-content -->
</article>
<?php endwhile; ?>
</main><!-- #main -->
<?php
get_footer();