Advertisement
Guest User

single-portfolio.php

a guest
Jan 20th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <main id="content" class="full-width" role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">
  4.  
  5. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  6.  
  7. <!-- Article -->
  8. <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?> itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  9.  
  10.  
  11. <header class="entry-header" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
  12.  
  13. <h1 class="entry-title" itemprop="headline"><?php the_title(); ?></h1>
  14.  
  15. <?php if ( has_excerpt() ) : ?>
  16.  
  17. <div class="entry-excerpt" itemprop="text">
  18. <?php the_excerpt(); ?>
  19. </div>
  20.  
  21. <?php endif; ?>
  22.  
  23. </header>
  24.  
  25.  
  26. <div class="entry-image clearfix">
  27.  
  28. <?php
  29. // First check if slideshow gallery is checked
  30. if ( get_post_meta( get_the_ID(), '_mighty_slideshow-gallery', true ) ) :
  31. ?>
  32.  
  33. <div class="flexslider">
  34. <ul class="slides">
  35. <?php mighty_gallery( $post->ID ); ?>
  36. </ul>
  37. </div>
  38.  
  39. <?php
  40. // Check for self-hosted video, if found display it
  41. elseif ( get_post_meta( get_the_ID(), '_mighty_video-url', true ) ) :
  42. ?>
  43.  
  44. <?php if ( has_post_thumbnail() ) : ?>
  45.  
  46. <?php
  47. $poster = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'l' );
  48. $url = $poster['0'];
  49. ?>
  50.  
  51. <?php echo do_shortcode( '[video src="' . get_post_meta( get_the_ID(), '_mighty_video-url', true ) . '" poster="' . $url . '" width="920"]' ); ?>
  52.  
  53. <?php else : ?>
  54.  
  55. <?php echo do_shortcode( '[video src="' . get_post_meta( get_the_ID(), '_mighty_video-url', true ) . '" width="920"]' ); ?>
  56.  
  57. <?php endif; ?>
  58.  
  59. <?php
  60. // Check for third-party embedded video, if found display it
  61. elseif ( get_post_meta( get_the_ID(), '_mighty_video-embed', true ) ) :
  62. ?>
  63.  
  64. <?php
  65. $wp_embed = new WP_Embed();
  66. $post_embed = $wp_embed->run_shortcode( '[embed width="920"]' . get_post_meta( get_the_ID(), '_mighty_video-embed', true ) . '[/embed]' );
  67. ?>
  68.  
  69. <?php echo $post_embed; ?>
  70.  
  71. <?php
  72. // Check if audio file has been assigned, if so, display it.
  73. elseif ( get_post_meta( get_the_ID(), '_mighty_audio-file', true ) ) :
  74. ?>
  75.  
  76. <?php if ( has_post_thumbnail() ) : ?>
  77. <?php the_post_thumbnail( 'l' ); ?>
  78. <?php endif; ?>
  79. <?php echo do_shortcode( '[audio src="' . get_post_meta( get_the_ID(), '_mighty_audio-file', true ) . '" width="920"]' ); ?>
  80.  
  81. <?php
  82. // Last resort, just display the single featured thumbnail.
  83. else :
  84. ?>
  85.  
  86. <?php if ( has_post_thumbnail() ) : ?>
  87. <?php the_post_thumbnail( 'l' ); ?>
  88. <?php endif; ?>
  89.  
  90. <?php endif; ?>
  91.  
  92. </div>
  93.  
  94.  
  95. <aside class="portfolio-meta clearfix">
  96.  
  97. <?php if ( get_post_meta( get_the_ID(), '_mighty_project-date', true ) ) : ?>
  98.  
  99. <p><span><?php _e( 'Date', 'reply' ); ?>:</span> <?php echo get_post_meta( $post->ID, '_mighty_project-date', true ) ?></p>
  100.  
  101. <?php endif; if ( get_post_meta( get_the_ID(), '_mighty_client-name', true ) ) : ?>
  102.  
  103. <?php if ( get_post_meta( get_the_ID(), '_mighty_client-url', true ) ) : ?>
  104.  
  105. <p><span><?php _e( 'Client', 'reply' ); ?>:</span> <a href="<?php echo get_post_meta( $post->ID, '_mighty_client-url', true ) ?>" title="<?php echo get_post_meta( $post->ID, '_mighty_client-name', true ) ?>"><?php echo get_post_meta( $post->ID, '_mighty_client-name', true ) ?></a></p>
  106.  
  107. <?php else : ?>
  108.  
  109. <p><span><?php _e( 'Client', 'reply' ); ?>:</span> <?php echo get_post_meta( $post->ID, '_mighty_client-name', true ) ?></p>
  110.  
  111. <?php endif; ?>
  112.  
  113. <?php endif; if ( get_post_meta( get_the_ID(), '_mighty_project-skills', true ) ) : ?>
  114.  
  115. <p><span><?php _e( 'Skills', 'reply' ); ?>:</span> <?php echo get_post_meta( $post->ID, '_mighty_project-skills', true ) ?></p>
  116.  
  117. <?php endif; if ( get_post_meta( get_the_ID(), '_mighty_project-url', true ) ) : ?>
  118.  
  119. <p class="project-button"><a href="<?php echo get_post_meta( $post->ID, '_mighty_project-url', true ) ?>" target="_blank"><?php if ( get_post_meta( get_the_ID(), '_mighty_project-link-text', true ) ) : ?><?php echo get_post_meta( $post->ID, '_mighty_project-link-text', true ); ?><?php else : ?><?php echo get_post_meta( $post->ID, '_mighty_project-url', true ) ?><?php endif; ?></a></p>
  120.  
  121. <?php endif; ?>
  122.  
  123. </aside>
  124.  
  125. <div class="entry-content" itemprop="text">
  126. <?php the_content(); ?>
  127. </div>
  128.  
  129. </article>
  130.  
  131. <?php endwhile; ?>
  132.  
  133. <!-- Article Nav -->
  134. <?php mighty_article_nav(); ?>
  135.  
  136. <?php endif; ?>
  137.  
  138. </main>
  139.  
  140. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement