Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Press Release Archive
- * Description: A duplicate of the standard page template (page.php), which includes
- * the media/press sidebar, when that template is used.
- *
- * @package American Well
- */
- get_header();
- ?>
- <div id="primary" class="content-area">
- <main id="main" class="site-main" role="main">
- <?php while ( have_posts() ) : the_post(); ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="entry-content">
- <?php the_content(); ?>
- <?php foreach ( aw_posts_by_year( 'press_release' ) as $year => $posts ) : ?>
- <h2><?php echo esc_html( $year ) ?></h2>
- <ul class="yellow-squares">
- <?php foreach ( $posts as $post ) : ?>
- <?php
- // check for alternate urls
- $meta = get_post_custom( $post->ID );
- // check first for local pdf
- if ( isset( $meta['press_release_alt_pdf'] ) && is_numeric( $meta['press_release_alt_pdf'][0] ) ) {
- $permalink = esc_url( wp_get_attachment_url( absint( $meta['press_release_alt_pdf'][0] ) ) );
- } elseif ( isset( $meta['press_release_alt_url'] ) && esc_url( $meta['press_release_alt_url'][0] != '' ) ) {
- $permalink = esc_url( $meta['press_release_alt_url'][0] );
- } else {
- $permalink = esc_url( get_permalink( $post->ID ) );
- }
- ?>
- <?php printf(
- '<li><a href="%s">%s</a><br /> %s</li>',
- esc_url( $permalink ),
- esc_html( get_the_title( $post->ID ) ),
- esc_html( get_the_date( 'F j, Y' , $post->ID ) )
- ) ?>
- <?php endforeach; ?>
- </ul>
- <?php endforeach; ?>
- </div><!-- .entry-content -->
- </article><!-- #post-## -->
- <aside class="media-contact">
- <?php dynamic_sidebar( 'press-sidebar' ); ?>
- </aside>
- <?php endwhile; // end of the loop. ?>
- </main><!-- #main -->
- </div><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement