Files
DESKTOP-GBA0BK8\Admin 7c8c8b1c76 first commit
2023-04-08 12:19:53 -04:00

101 lines
3.5 KiB
PHP

<?php
get_header();
?>
<?php
// count post views
float_set_post_views(get_the_ID());
// Get co-authors
$authors = [];
$co_authors = get_coauthors(get_the_ID());
foreach($co_authors as $co_author) {
if(get_class($co_author) !== 'WP_User') {
array_push($authors, $co_author->display_name);
continue;
}
array_push($authors, $co_author->data->display_name);
}
if (empty($authors)) {
$post_author = get_the_author_meta( 'display_name' , get_post_field('post_author') );
array_push($authors, $post_author);
}
?>
<main class="main-content container">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="title-section text-center">
<h1>
<?php the_title(); ?>
</h1>
<p class="author">
<?php if (!empty(get_the_author_meta( 'display_name' , get_post_field('post_author') ))): ?>
by <?php echo join(", ",$authors); ?>
<?php endif; ?>
</p>
</div>
<?php if (!empty(get_post_field('video_link'))): ?>
<div class="video-section mt-5">
<?php echo do_shortcode('[arve aspect_ratio="4:2" autoplay="yes" loop="yes" maxwidth="auto" url="' . get_post_field('video_link') . '" /]'); ?>
</div>
<?php elseif (!empty(get_the_post_thumbnail( get_the_ID(), 'full' ))): ?>
<div class="featured-img-section mt-5">
<img class="w-100 h-100" src="<?php echo get_the_post_thumbnail_url( get_the_ID(), 'full' ); ?>">
</div>
<?php endif; ?>
<div class="content-section mt-5">
<?php if (get_post_status() == 'future'): ?>
<h3 class="text-center">This post is going to be published on <?php echo get_the_date( 'l, F j, Y H:i A' ); ?></h3>
<?php else: ?>
<div>
<div class="row no-gutters">
<div class="content-section__body col-md-8">
<?php echo get_post_field('post_content'); ?>
<div class="social-share">
<?php echo do_shortcode('[Sassy_Social_Share]') ?>
</div>
</div>
<div class="content-section__sidebar col-md-4 d-none d-md-block">
<?php get_sidebar(); ?>
</div>
</div>
</div>
<?php endif;?>
</div>
</article>
<?php
if ( comments_open() || get_comments_number() ) {
comments_template();
}
?>
</main>
<div class="subcribe-form-section w-100 pl-1 pr-1">
<h3 class="subcribe-form-section__heading text-center">Want to read more like this? Sign-up for Float.</h3>
<div class="subcribe-form-section__body mt-5 mx-auto">
<form class="subscribe-form" id="subscribe-form" method="POST" data-action="/newsletter-subscribe">
<div class="form-group">
<input type='text' class="form-control" name="name" placeholder="name" />
</div>
<div class="form-group">
<input type='email' class="form-control" name="email" placeholder="email" />
</div>
</form>
<div class="form-msg-block"></div>
<button type="button" class="btn subcribe-button">Sign-up</button>
</div>
</div>
<?php
get_footer();
?>