<?php
$current_url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$dashboard_url = get_permalink(get_option('woocommerce_myaccount_page_id'));
$custom_endpoint = $dashboard_url == $current_url;

if (is_wc_endpoint_url('lost-password')) {
    get_template_part('woocommerce/myaccount/dashboard/lost-password-woocommerce');
} else if (is_account_page() && $custom_endpoint) {
    get_template_part('woocommerce/myaccount/my-account');
} else if (is_account_page() && !$custom_endpoint && !is_user_logged_in()) {
    get_template_part('woocommerce/myaccount/my-account');
} else if (is_account_page() && !$custom_endpoint) {
    get_header();
    get_template_part('woocommerce/myaccount/dashboard/panel');
    get_footer();
} else if (is_page()) {
?>

<?php get_header(); ?>
<div class="container">
  <div class="page-content">

    <?php
    if ( have_posts() ) :
        while ( have_posts() ) : the_post(); ?>
        <?php gt_set_post_view(); ?>
    <article class="single-title">
      <div class="single-post-thumbnail">
        <figure>
          <?php the_post_thumbnail(); ?>
        </figure>
      </div>
      <div class="post-content">
        <?php the_content(); ?>
      </div>
    </article>
    <?php
    endwhile;
endif;
?>

<?php if ( comments_open() || get_comments_number() ) : ?>
  <div class="clear"></div><br><div class="post-comments">
    <div class="comments-title">
      <h3>نظرات:</h3>
    </div>
    <?php

    comments_template();

    ?>
  </div>
<?php endif; ?>
  </div>
</div>
<?php get_footer(); ?>


<?php } ?>
