<?php
/**
 * The template for displaying all single posts
 *
 * @package ClubFitness
 */

get_header(); ?>

<section id="content" class="content content-single">
	<div class="container-fluid px-0">
		<div class="row g-0">
			<div class="col-12 col-lg-7 order-1 order-lg-0">
				<div class="content-left position-relative p-4 bg-white">
			<?php if ( have_posts() ) : ?>
				<?php while ( have_posts() ) : ?>
					<?php the_post(); ?>
					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
						<div class="post-item">
						<?php if ( has_post_thumbnail() ) : ?>
							<div class="post-image position-relative">	
								<?php the_post_thumbnail( 'large' ); ?>
							<?php endif; ?>
								<?php if ( has_post_thumbnail() ) : ?>
									<div class="post-categories-list position-absolute p-4">
								<?php else : ?>
									<div class="post-categories-list">
								<?php endif; ?>
									<?php echo wp_kses_post( get_the_category_list() ); ?>
								</div>
							<?php if ( has_post_thumbnail() ) : ?>
							</div>
						<?php endif; ?>
							<div class="post-info py-4">
								<div class="post-title">
									<h1><?php the_title(); ?></h1>
								</div>
								<?php get_template_part( 'inc/post', 'meta' ); ?>
								<div class="post-message">
									<?php the_content(); ?>
									<?php
									wp_link_pages(
										array(
											'before' => '<div class="page-link">' . __( 'Pages:', 'clubfitness' ),
											'after'  => '</div>',
										)
									);
									?>
								</div>
								<div class="post-edit mb-4 clearfix">
									<?php edit_post_link( __( 'Edit', 'clubfitness' ), '<span class="edit-link">', '</span>' ); ?>
								</div>
								<div class="post-tags mb-4">
									<?php the_tags( '<p class="tags">', ' ', '</p>' ); ?>
								</div>
							</div>
							<?php if ( comments_open() || '0' !== get_comments_number() ) : ?>
								<?php comments_template( '', true ); ?>
							<?php endif; ?>
							<div class="post-navigation">
								<div class="row">
									<div class="col-xs-12 col-sm-6">
										<?php previous_post_link(); ?>
									</div>
									<div class="col-xs-12 col-sm-6 text-end">
										<?php next_post_link(); ?>
									</div>
								</div>
							</div>
						</div>
					</div>
				<?php endwhile; ?>
			<?php endif; ?>
				</div>
			</div>
			<div class="col-12 col-lg-5 order-0 order-lg-1">
				<div class="content-right position-fixed">
					<?php get_template_part( 'inc/content-right' ); ?>
				</div>
			</div>
		</div>
	</div>
</section>

<?php get_footer(); ?>
