Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.53 KB | None | 0 0
  1. <?php
  2.  
  3. // =============================================================================
  4. // VIEWS/INTEGRITY/WP-SINGLE.PHP
  5. // -----------------------------------------------------------------------------
  6. // Single artist post output for Integrity.
  7. // =============================================================================
  8.  
  9. $fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
  10.  
  11. if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) { // Execute code if user is logged in or user is the author
  12.     acf_form_head();
  13.     wp_deregister_style( 'wp-admin' );
  14. }
  15. get_header();
  16.  
  17. ?>
  18.  
  19.   <div class="x-container max width offset">
  20.     <div class="<?php x_main_content_class(); ?>" role="main">
  21.  
  22.       <?php while ( have_posts() ) : the_post(); ?>
  23.         <?php x_get_view( 'ethos', 'artists', get_post_format() ); ?>
  24.         <?php x_get_view( 'global', '_comments-template' ); ?>
  25.       <?php endwhile; ?>
  26.  
  27.     </div>
  28.  
  29. <div>
  30.  
  31. <?php
  32. /* Show the edit button to the post author only */
  33. if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) { ?>
  34. <a class='post-edit-button' href="<?php echo get_permalink() ?>?action=edit">Edit Post</a>
  35.  
  36. <?php }
  37.  
  38.     if (isset($_GET['action'])) {
  39.         if($_GET['action'] == 'edit') { ?>
  40.             <div class="acf-edit-post">
  41.               <?php
  42.                   if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) {
  43.                       echo "<div class='acf-edit-post'>";
  44.                           acf_form (array(
  45.                               'field_groups' => array(478,5977), // Same ID(s) used before
  46.                               'form' => true,
  47.                               'return' => '%post_url%',
  48.                               'submit_value' => 'Save Changes',
  49.                               'post_title' => true,
  50.                               'post_content' => true,
  51.                           ));
  52.                       echo "</div>";
  53.                   }
  54.               ?>
  55.             </div>
  56.         <?php }
  57.     }
  58. ?>
  59. </div>
  60.  
  61. <div id="container">
  62.  
  63.     <div id="left-col">
  64.  
  65.       <div class="entry-featured"><br /><br />
  66.         <?php the_post_thumbnail('thumbnail'); ?>
  67.       </div><!--end entry featured div-->
  68.  
  69. <div  class="profile-field"><strong>LOCATION:</strong>&nbsp;<?php echo get_post_meta( get_the_ID() , 'location', true ); ?>
  70. </div>  
  71.  
  72.     </div><!--end left column div-->
  73.  
  74.  
  75.     <div id="right-col">
  76.  
  77. <h1><?php the_title(); ?></h1>
  78.  
  79. <div class="social-profile">
  80.  
  81. <?php if( get_field('website') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'website', true ); ?>" class="website" title="Website" target="_blank" style="outline: medium none;"><i class="fa fa-globe" aria-hidden="true"></i></a><?php endif; ?>
  82.  
  83. <?php if( get_field('instagram') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'instagram', true ); ?>" class="instagram" title="Instagram" target="_blank">
  84. <i class="x-icon-instagram-square" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>
  85.  
  86. <?php if( get_field('facebook') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'facebook', true ); ?>" class="facebook" title="Facebook" target="_blank" style="outline: medium none;"><i class="x-icon-facebook-square" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>
  87.  
  88. <?php if( get_field('twitter') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'twitter', true ); ?>" class="twitter" title="Twitter" target="_blank">
  89. <i class="x-icon-twitter-square" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>
  90.  
  91. <?php if( get_field('youtube') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'youtube', true ); ?>" class="youtube" title="Youtube" target="_blank">
  92. <i class="x-icon-youtube" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>&nbsp;&nbsp;
  93.  
  94. <br> <br>
  95.  
  96.  
  97. </div><!--end social profile div-->
  98.  
  99. <div class="bio">
  100. <?php if( get_field('bio') ): ?>
  101.     <?php the_field('bio'); ?>
  102. <?php endif; ?>
  103. </div>
  104.  
  105. <div class="logo">
  106. <?php
  107.  
  108. $image = get_field('logo');
  109.  
  110. if( !empty($image) ): ?>
  111.  
  112.   <a href="<?php echo $image['url']; ?>" rel="foobox"><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" width="200" /></a>
  113.   <br><br>
  114.  
  115. <?php endif; ?>
  116. </div>
  117.  
  118.     </div><!--end right column div-->
  119. </div><!--end scontainer div-->
  120. <div id="container">
  121.  
  122. <div class="embed-container">
  123.   <?php the_field('featured_video'); ?>
  124. </div>
  125. <style>
  126.   .embed-container {
  127.     position: relative;
  128.     padding-bottom: 56.25%;
  129.     height: 0;
  130.     overflow: hidden;
  131.     max-width: 100%;
  132.     height: auto;
  133.   }
  134.  
  135.   .embed-container iframe,
  136.   .embed-container object,
  137.   .embed-container embed {
  138.     position: absolute;
  139.     top: 0;
  140.     left: 0;
  141.     width: 100%;
  142.     height: 100%;
  143.   }
  144. </style>
  145. <div class="gap"><br><br><br></div>
  146.  
  147.       <div class="gallery"><br><br>
  148.  
  149. <?php
  150.  
  151. $images = get_field('gallery');
  152.  
  153. if( $images ): ?>
  154.     <ul class="gallery">
  155.         <?php foreach( $images as $image ): ?>
  156.             <li>
  157.                 <a href="<?php echo $image['url']; ?>" rel="foobox">
  158.                      <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
  159.                 </a>
  160.                 <p><?php echo $image['caption']; ?></p>
  161.             </li>
  162.         <?php endforeach; ?>
  163.     </ul>
  164. <?php endif; ?>
  165.  
  166.  
  167.  
  168.       </div><!-- end gallery div -->
  169.  
  170.  
  171.  </div>
  172.  
  173.  
  174.  
  175.     <?php if ( $fullwidth != 'on' ) : ?>
  176.       <?php //get_sidebar(); ?>
  177.     <?php endif; ?>
  178.     </div>
  179.  
  180.  
  181. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement