Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // =============================================================================
- // VIEWS/INTEGRITY/WP-SINGLE.PHP
- // -----------------------------------------------------------------------------
- // Single artist post output for Integrity.
- // =============================================================================
- $fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
- if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) { // Execute code if user is logged in or user is the author
- acf_form_head();
- wp_deregister_style( 'wp-admin' );
- }
- get_header();
- ?>
- <div class="x-container max width offset">
- <div class="<?php x_main_content_class(); ?>" role="main">
- <?php while ( have_posts() ) : the_post(); ?>
- <?php x_get_view( 'ethos', 'artists', get_post_format() ); ?>
- <?php x_get_view( 'global', '_comments-template' ); ?>
- <?php endwhile; ?>
- </div>
- <div>
- <?php
- /* Show the edit button to the post author only */
- if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) { ?>
- <a class='post-edit-button' href="<?php echo get_permalink() ?>?action=edit">Edit Post</a>
- <?php }
- <?php
- if (isset($_GET['action'])) {
- if($_GET['action'] == 'edit') { ?>
- <div class="acf-edit-post">
- <?php
- if ( ( is_user_logged_in() && $current_user->ID == $post->post_author ) ) {
- echo "<div class='acf-edit-post'>";
- acf_form (array(
- 'field_groups' => array(478,5977), // Same ID(s) used before
- 'form' => true,
- 'return' => '%post_url%',
- 'submit_value' => 'Save Changes',
- 'post_title' => true,
- 'post_content' => true,
- ));
- echo "</div>";
- }
- ?> </div>
- <?php }
- }
- ?>
- </div>
- <div id="container">
- <div id="left-col">
- <div class="entry-featured"><br /><br />
- <?php the_post_thumbnail('thumbnail'); ?>
- </div><!--end entry featured div-->
- <div class="profile-field"><strong>LOCATION:</strong> <?php echo get_post_meta( get_the_ID() , 'location', true ); ?>
- </div>
- </div><!--end left column div-->
- <div id="right-col">
- <h1><?php the_title(); ?></h1>
- <div class="social-profile">
- <?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; ?>
- <?php if( get_field('instagram') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'instagram', true ); ?>" class="instagram" title="Instagram" target="_blank">
- <i class="x-icon-instagram-square" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>
- <?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; ?>
- <?php if( get_field('twitter') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'twitter', true ); ?>" class="twitter" title="Twitter" target="_blank">
- <i class="x-icon-twitter-square" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>
- <?php if( get_field('youtube') ): ?><a href="<?php echo get_post_meta( get_the_ID() , 'youtube', true ); ?>" class="youtube" title="Youtube" target="_blank">
- <i class="x-icon-youtube" data-x-icon="" aria-hidden="true"></i></a><?php endif; ?>
- <br> <br>
- </div><!--end social profile div-->
- <div class="bio">
- <?php if( get_field('bio') ): ?>
- <?php the_field('bio'); ?>
- <?php endif; ?>
- </div>
- <div class="logo">
- <?php
- $image = get_field('logo');
- if( !empty($image) ): ?>
- <a href="<?php echo $image['url']; ?>" rel="foobox"><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" width="200" /></a>
- <br><br>
- <?php endif; ?>
- </div>
- </div><!--end right column div-->
- </div><!--end scontainer div-->
- <div id="container">
- <div class="embed-container">
- <?php the_field('featured_video'); ?>
- </div>
- <style>
- .embed-container {
- position: relative;
- padding-bottom: 56.25%;
- height: 0;
- overflow: hidden;
- max-width: 100%;
- height: auto;
- }
- .embed-container iframe,
- .embed-container object,
- .embed-container embed {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- </style>
- <div class="gap"><br><br><br></div>
- <div class="gallery"><br><br>
- <?php
- $images = get_field('gallery');
- if( $images ): ?>
- <ul class="gallery">
- <?php foreach( $images as $image ): ?>
- <li>
- <a href="<?php echo $image['url']; ?>" rel="foobox">
- <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
- </a>
- <p><?php echo $image['caption']; ?></p>
- </li>
- <?php endforeach; ?>
- </ul>
- <?php endif; ?>
- </div><!-- end gallery div -->
- </div>
- <?php if ( $fullwidth != 'on' ) : ?>
- <?php //get_sidebar(); ?>
- <?php endif; ?>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement