<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
get_header();
$theme_options = pmthemes_theme_options();
echo '<div id="wrap" class="clearfix">';
        if ( $theme_options['pmthemes_display_fullw'] == false ) :
            echo '<section id="content" class="primary" role="main">';
        else:
            echo '<section id="content-full" class="primary" role="main">';
        endif;
        // Display Archive Title According to Type
         echo '<h2 class="archive-title '. $theme_options['pmth_arc_align_header'] .'">';
            if( is_category() ) {
                printf(__('Category Archives: %s', 'pmthemes'), '<span>' . single_cat_title( '', false ) . '</span>');
            } elseif ( is_tag() ) {
                printf(__('Tag Archives: %s', 'pmthemes'), '<span>' . single_cat_title( '', false ) . '</span>');
            } elseif ( is_date() ) {
                printf( __( 'Monthly Archives: %s', 'pmthemes' ), '<span>' . get_the_date( _x( 'F Y', 'date format of monthly archives', 'pmthemes' ) ) . '</span>' );
            } else {
                _e( 'Archives fda', 'pmthemes' );
            }
        echo '</h2>';
        do_action('pmthemes_before_archive_content');
        if ( $theme_options['pmth_grid_col_opt'] == 'pmth-grid-coln' ) {
            $gridopt = $theme_options['pmth_grid_column'];
        } else {
            $gridopt = $theme_options['pmth_grid_width'];
        }
        echo '<div class="pmth-grid '. $gridopt .'">';
            // Display Content
            if (have_posts()) :
                while (have_posts()) : the_post();
                    get_template_part( 'template-parts/content', $theme_options['posts_length'] );
                endwhile;
            endif;
        echo '</div>';
        pmthemes_display_pagination();
        do_action('pmthemes_after_archive_content');
    echo '</section>';

    // Display Sidebar
    if ( $theme_options['pmthemes_display_fullw'] == false ) :
        get_sidebar();
    endif;
echo '</div>';
get_footer();