content-portfolio.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * The template used for displaying Jetpack Portfolio posts on single portfolio pages
  4. *
  5. * @package Lodestar
  6. */
  7. ?>
  8. <?php
  9. // Add post ID plus formatting as class for filtering
  10. $portfolio_data = lodestar_portfolio_data();
  11. ?>
  12. <article id="post-<?php the_ID(); ?>" <?php post_class( $portfolio_data ); ?>>
  13. <?php if ( has_post_thumbnail() ) : ?>
  14. <div class="post-thumbnail">
  15. <?php
  16. $project_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'lodestar-portfolio-archive-image' );
  17. $alt_text = get_post_meta( get_post_thumbnail_id( $post->ID ), '_wp_attachment_image_alt', true );
  18. if ( is_page_template( 'templates/portfolio-page.php' ) ) : ?>
  19. <img data-original="<?php echo esc_url( $project_image[0] ); ?>" width="900" height="600" class="portfolio-featured-image" alt="<?php echo esc_attr( $alt_text ); ?>" title="<?php the_title_attribute(); ?>">
  20. <?php else : ?>
  21. <img src="<?php echo esc_url( $project_image[0] ); ?>" width="900" height="600" class="portfolio-featured-image" alt="<?php echo esc_attr( $alt_text ); ?>" title="<?php the_title_attribute(); ?>">
  22. <?php endif; ?>
  23. </div><!-- .post-thumbnail -->
  24. <?php endif; ?>
  25. <div class="project-archive-content">
  26. <div class="project-archive-content-wrapper">
  27. <header class="entry-header">
  28. <?php if ( is_single() ) {
  29. the_title( '<h1 class="entry-title">', '</h1>' );
  30. } else {
  31. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  32. } ?>
  33. </header>
  34. <div class="entry-meta">
  35. <?php lodestar_portfolio_meta(); ?>
  36. </div><!-- .entry-meta -->
  37. <footer class="entry-footer">
  38. <?php lodestar_edit_post_link(); ?>
  39. </footer><!-- .entry-footer -->
  40. </div><!-- .project-archive-content-wrap -->
  41. </div><!-- .project-archive-content -->
  42. </article><!-- #post-<?php the_ID(); ?> -->