navasena/wp-content/themes/thinkai/archive.php

122 lines
4.1 KiB
PHP
Raw Permalink Normal View History

2024-07-31 13:12:38 +07:00
<?php
/**
* Archive Main File.
*
* @package THINKAI
* @author Theme Kalia
* @version 1.0
*/
get_header();
$options = thinkai_WSH()->option();
global $wp_query;
$data = \THINKAI\Includes\Classes\Common::instance()->data( 'archive' )->get();
$layout = $data->get( 'layout' );
$sidebar = $data->get( 'sidebar' );
$layout = ( $layout ) ? $layout : 'right';
$sidebar = ( $sidebar ) ? $sidebar : 'default-sidebar';
if (is_active_sidebar( $sidebar )) {$layout = 'right';} else{$layout = 'full';}
$class = ( !$layout || $layout == 'full' ) ? 'col-xl-12 col-lg-12 col-md-12' : 'col-xl-8 col-lg-12 col-md-12';
if ( class_exists( '\Elementor\Plugin' ) AND $data->get( 'tpl-type' ) == 'e' AND $data->get( 'tpl-elementor' ) ) {
echo Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $data->get( 'tpl-elementor' ) );
} else {
if (is_category()) {
$title = single_cat_title('', false);
} elseif (is_tag()) {
$title = single_tag_title('', false);
} elseif (is_author()) {
$title = get_the_author_meta('display_name', get_queried_object_id());
} elseif (is_day()) {
$title = get_the_date();
} elseif (is_month()) {
$title = get_the_date('F Y');
} elseif (is_year()) {
$title = get_the_date('Y');
} else {
$title = __('Archives', 'thinkai');
}
?>
<?php if ( $data->get( 'enable_banner' ) ) : ?>
<?php do_action( 'thinkai_banner', $data );?>
<?php else:?>
<!--Start breadcrumb Style1-->
<section class="breadcrumb-style1 <?php if( $data->get( 'banner' ) ) echo 'm-t130'?>">
<?php if( $data->get( 'banner' ) ){?>
<div id="particles-js"></div>
<div class="breadcrumb-style1-bg" style="background-image: url(<?php echo esc_url( $data->get( 'banner' ) ); ?>);"></div>
<?php } ?>
<!--Start Scrolling Text Style6-->
<?php
$features_list = $options->get('archive_features_list');
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<div class="scrolling-text-style6">
<div class="inner">
<ul class="clearfix marquee_mode">
<?php foreach($features_list as $features): ?>
<li data-hover="<?php echo wp_kses($features, true); ?>">
<?php echo wp_kses($features, true); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php } ?>
<!--End Scrolling Text Style6-->
<div class="container">
<div class="inner-content">
<div class="title text-center">
<h2><?php if ($data->get('title')) { echo wp_kses($data->get('title'), true); } else { echo esc_html($title); } ?></h2>
</div>
</div>
</div>
</section>
<!--End breadcrumb Style1-->
<?php endif;?>
<!--Start Blog Page Three-->
<section class="blog-page-three">
<div class="container">
<div class="row">
<?php
if ( $data->get( 'layout' ) == 'left' ) {
do_action( 'thinkai_sidebar', $data );
}
?>
<div class="content-side <?php echo esc_attr( $class ); ?> <?php if ( $data->get( 'layout' ) == 'left' ) echo 'pl-0'; elseif ( $data->get( 'layout' ) == 'right' ) echo ''; ?>">
<div class="blog-page-three__content">
<div class="thm-unit-test">
<?php
while ( have_posts() ) :
the_post();
thinkai_template_load( 'templates/blog/blog.php', compact( 'data' ) );
endwhile;
wp_reset_postdata();
?>
</div>
<!--Pagination-->
<div class="pagination-wrapper styled-pagination centred">
<?php thinkai_the_pagination( $wp_query->max_num_pages );?>
</div>
</div>
</div>
<?php
if ( $data->get( 'layout' ) == 'right' ) {
do_action( 'thinkai_sidebar', $data );
}
?>
</div>
</div>
</section>
<!--End blog area-->
<?php
}
get_footer();