<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that other
 * 'pages' on your WordPress site will use a different template.
 *
 * @package WordPress
 * @subpackage Azoom
 * @since Azoom 1.0
 */

get_header(); ?>
<?php do_action('rockthemes_pb_frontend_before_page'); ?>
<?php if(defined('RPB_FULL_SHORTCODE')){ echo '<!-- Regular Content Area --><div class="row">';} ?>
<?php if(function_exists('rockthemes_pb_frontend_sidebar_before_content')) rockthemes_pb_frontend_sidebar_before_content(); ?>

	<div id="primary" class="content-area <?php echo rockthemes_pb_return_main_grid_col_class(); ?>">
		<div id="content" class="site-content" role="main">

			<?php /* The loop */ ?>
			<?php while ( have_posts() ) : the_post(); ?>

				<div id="post-<?php the_ID(); ?>">
                	<?php if(has_post_thumbnail() && get_post_meta($post->ID,'_builder_in_use',true) !== 'true'): ?>
					<header class="entry-header">

						<?php if ( has_post_thumbnail() && ! post_password_required()) : ?>
							<?php if(get_post_meta($post->ID,'_builder_in_use',true) !== 'true'): ?>
                                <div class="entry-thumbnail">
                                    <?php azoom_get_featured_image(); ?>
                                </div>
                            <?php else: ?>
                                <?php if(rockthemes_pb_featured_in_builder() !== "true"): ?>
                                <div class="entry-thumbnail">
                                    <?php azoom_get_featured_image(); ?>
                                </div>
                                <?php endif; ?>
                        	<?php endif; ?>
                        
						<?php endif; ?>
						
                        <?php 
						global $azoom_disable_regular_title;
						if(!$azoom_disable_regular_title):
						?>
						<h2 class="entry-title"><?php the_title(); ?></h2>
                        <?php
						endif;
						?>
					</header><!-- .entry-header -->
                    <?php endif; ?>

					<div class="entry-content">
						<?php the_content(); ?>
						<?php azoom_get_link_pages(); ?>
                    </div><!-- .entry-content -->

				</div><!-- #post -->
				
				<?php 
				if(xr_get_option('activate_comments_on_pages', false)){
					comments_template();
				}
				 ?>
			<?php endwhile; ?>
            
		</div><!-- #content -->
	</div><!-- #primary -->
<?php 
if(function_exists('rockthemes_pb_frontend_sidebar_after_content')) rockthemes_pb_frontend_sidebar_after_content();
else get_sidebar();
?>
<?php if(defined('RPB_FULL_SHORTCODE')){ echo '</div><!-- /End of Regular Content Area -->';} ?>
<?php do_action('rockthemes_pb_frontend_after_page'); ?>
<?php get_footer(); ?>