<?php
/**
 * The loop that displays posts
 *
 * The loop displays the posts and the post content. See
 * https://developer.wordpress.org/themes/basics/the-loop/ to understand it and
 * https://developer.wordpress.org/themes/basics/template-tags/ to understand
 * the tags used in it.
 *
 * This can be overridden in child themes with loop.php or
 * loop-template.php, where 'template' is the loop context
 * requested by a template. For example, loop-index.php would
 * be used if it exists and we ask for the loop with:
 * <code>get_template_part( 'loop', 'index' );</code>
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */
?>

<?php // Display navigation to next/previous pages when applicable. ?>
<?php
if ( $wp_query->max_num_pages > 1 ) :
	$is_desc = ( 'DESC' === get_query_var( 'order', 'DESC' ) );

	$new_posts_text = __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' );
	$old_posts_text = __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' );

	$prev_link = $is_desc ? get_next_posts_link( $old_posts_text ) : get_previous_posts_link( $old_posts_text );
	$next_link = $is_desc ? get_previous_posts_link( $new_posts_text ) : get_next_posts_link( $new_posts_text );
	?>
	<div id="nav-above" class="navigation">
	<?php if ( $prev_link ) : ?>
		<div class="nav-previous"><?php echo $prev_link; ?></div>
	<?php endif; ?>

	<?php if ( $next_link ) : ?>
		<div class="nav-next"><?php echo $next_link; ?></div>
	<?php endif; ?>
	</div><!-- #nav-above -->
<?php endif; ?>

<?php /* If there are no posts to display, such as an empty archive page */ ?>
<?php if ( ! have_posts() ) : ?>
	<div id="post-0" class="post error404 not-found">
		<h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
		<div class="entry-content">
			<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
			<?php get_search_form(); ?>
		</div><!-- .entry-content -->
	</div><!-- #post-0 -->
<?php endif; ?>

<?php
	/*
	 * Start the Loop.
	 *
	 * In Twenty Ten we use the same loop in multiple contexts.
	 * It is broken into three main parts: when we're displaying
	 * posts that are in the gallery category, when we're displaying
	 * posts in the asides category, and finally all other posts.
	 *
	 * Additionally, we sometimes check for whether we are on an
	 * archive page, a search page, etc., allowing for small differences
	 * in the loop on each template without actually duplicating
	 * the rest of the loop that is shared.
	 *
	 * Without further ado, the loop:
	 */
?>
<?php
while ( have_posts() ) :
	the_post();
	?>

	<?php /* How to display posts of the Gallery format. The gallery category is the old way. */ ?>

	<?php if ( ( function_exists( 'get_post_format' ) && 'gallery' === get_post_format( $post->ID ) ) || in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
		

		<?php /* How to display posts of the Aside format. The asides category is the old way. */ ?>

	<?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' === get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?>
	

		<?php /* How to display all other posts. */ ?>

	<?php else : ?>
		
		
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		
		
		
		
<!-- Post 1 -->
<div id="p6326" class="post has-profile bg2 unreadpost">
                    <div class="inner">
                        <dl class="postprofile" id="profile6326">
                            <dt class="no-profile-rank has-avatar">
                                <div class="avatar-container">
                                    <a href="#" class="avatar"><img class="avatar" src="<?php the_field("profile_pic"); ?>" width="83" height="101" alt="User avatar"></a>
                                </div>
                                <a href="#" class="username"><?php the_field("name"); ?></a>
                            </dt>
                            <dd class="profile-posts">
                                <strong>Posts:</strong> <a href="#"><?php the_field("posts"); ?></a>
                            </dd>
                            <dd class="profile-joined">
                                <strong>Joined:</strong> <?php the_field("date"); ?>
                            </dd>
                        </dl>
                        <div class="postbody">
                            <div id="post_content6326">
                                <h3><a href="#p6326">Re: Seeking Recommendations: Should I Extend MyCar Warranty? Looking for Expert Insights</a></h3>
                                <ul class="post-buttons">
                                    <li>
                                        <a href="#" title="Reply with quote" class="button button-icon-only">
                                            <i class="icon fa-quote-left fa-fw" aria-hidden="true"></i><span class="sr-only">Quote</span>
                                        </a>
                                    </li>
                                    <li class="responsive-menu hidden dropdown-container">
                                        <a href="javascript:" class="js-responsive-menu-link responsive-menu-link button dropdown-toggle"><i class="icon fa-bars fa-fw" aria-hidden="true"></i></a>
                                        <div class="dropdown">
                                            <div class="pointer">
                                                <div class="pointer-inner"></div>
                                                <ul class="dropdown-contents"></ul>
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                                <p class="author">
                                    <a class="unread" href="#" title="Unread post">
                                        <i class="icon fa-file fa-fw icon-red icon-md" aria-hidden="true"></i><span class="sr-only">Unread post</span>
                                    </a>
                                    <span class="responsive-hide">by <strong><a href="#" class="username"><?php the_field("name"); ?></a></strong> &raquo; </span><?php the_field("date"); ?>
                                </p>
								
								<h4><?php the_title(); ?></h4><br>
                                <div class="content">
								
			<?php the_content(); ?>
								
								</div>
                                <div id="sig6326" class="signature">
                                    <?php the_field("more_info"); ?>
                                </div>
                            </div>
                        </div>
                        <div class="back2top">
                            <a href="#top" class="top" title="Top">
                                <i class="icon fa-chevron-circle-up fa-fw icon-gray" aria-hidden="true"></i>
                                <span class="sr-only">Top</span>
                            </a>
                        </div>
                    </div>
                </div>
                <hr class="divider">
<!-- Post 1 -->		
		
		
		
		
</div><!-- #post-<?php the_ID(); ?> -->

		<?php comments_template( '', true ); ?>

	<?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>

<?php endwhile; // End of the loop. Whew. ?>

<?php // Display navigation to next/previous pages when applicable. ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
				<div id="nav-below" class="navigation">
				<!--<?php if ( $prev_link ) : ?>
					<div class="nav-previous"><?php echo $prev_link; ?></div>
				<?php endif; ?>

				<?php if ( $next_link ) : ?>
					<div class="nav-next"><?php echo $next_link; ?></div>
				<?php endif; ?>-->
				
				<?php wp_pagenavi(); ?>
				</div><!-- #nav-below -->
<?php endif; ?>
