<?php 
get_header();
global $redux_demo;
?>
<!-- www.20script.ir -->
<section id="main" role="main">
    <div class="container">
        <div class="row">
            <div class="col-sm-9 right-content">
                <div class="row">
                    <?php if($redux_demo['ad1'] != '') {
                        echo '<div class="header_ad">' . $redux_demo['ad1'] . '</div>';
                    } ?>
                    <div class="col-sm-9">
                        <?php if($redux_demo['ad2'] != '') {
                            echo '<div class="header_ad">' . $redux_demo['ad2'] . '</div>';
                        } ?>
                        <div class="main-wrap">
                            <?php 
                            if(isset($_GET['success']) && $_GET['success'] == '1') {
                                echo '<div class="alert alert-success">' . __("The post has been successfully added! If it's not visible, it might require approval from the site administrator!", 'Aruna') . '</div>';
                            }
                            if(isset($_GET['posterror']) && $_GET['posterror'] == '1') {
                                echo '<div class="alert alert-danger">' . __("The post couldn't be added, make sure you filled in all the required fields!", 'Aruna') . '</div>';
                            }
                            if(isset($_GET['register']) && $_GET['register'] == '1') {
                                echo '<div class="alert alert-success">' . __('Registration complete. Please check your e-mail for the password!', 'Aruna') . '</div>';
                            }
                            if(isset($_GET['register']) && $_GET['register'] == 'failed') {
                                echo '<div class="alert alert-danger">' . __('Registration failed! Make sure you filled all the fields and that they are correct.', 'Aruna') . '</div>';
                            }
                            if(isset($_GET['login']) && $_GET['login'] == 'failed') {
                                echo '<div class="alert alert-danger">' . __('Login failed! Make sure the username & password are correct!', 'Aruna') . '</div>';
                            }
                            if ( have_posts() ) :
                                $count = 1;
                                while ( have_posts() ) : the_post(); 
                                    if($count == 3 && $redux_demo['ad3'] != '') {
                                        echo '<div class="header_ad ad_between">' . $redux_demo['ad3'] . '</div>';
                                    }
                                    get_template_part( 'content', get_post_format() );
                                    $count++;
                                endwhile; 
                                get_template_part('includes/pagination');
                            endif; 
                            ?>
                        </div>
                    </div>
                    <?php get_sidebar('right');?>
                </div>
            </div>
            <?php get_sidebar('left');?>
        </div>
    </div>
</section>
<?php get_footer();?>