forked from SayflyAM/Amir-Travel-Europe---Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
74 lines (57 loc) · 2.28 KB
/
index.php
File metadata and controls
74 lines (57 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Travel Tour
*/
get_header();
global $wp_query;
$max_pages = $wp_query->max_num_pages;
?>
<?php
$sidebar_layout = travel_tour_get_sidebar_layout();
$view = get_theme_mod( 'blog_post_view', 'list-view' );
$content_column_class = 'col-md-9';
$sidebar_left_class = 'col-md-3';
$sidebar_right_class = 'col-md-3';
if( $sidebar_layout == 'no-sidebar' ) {
$content_column_class = 'col-md-12';
}
?>
<?php if ( have_posts() ) { ?>
<div class="my-64">
<div class="container-xl">
<div class="row">
<?php if( $sidebar_layout == 'left-sidebar' ) { ?>
<div class="<?php echo esc_attr( $sidebar_left_class ); ?>"><?php get_sidebar(); ?></div>
<?php } ?>
<div class="d-flex flex-column <?php echo esc_attr( $content_column_class ); ?>">
<?php $archive_title = get_theme_mod( 'blog_post_section_title' ); ?>
<?php if( ! empty( $archive_title ) ) { ?><h1 class="mb-32"><?php echo esc_html( $archive_title ); ?></h1><?php } ?>
<div class="w-p100 grid gap-20 gap-sm-40 overflow-hidden">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'template-parts/content', null, array(
'view' => $view
) );
?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</div>
<?php travel_tour_pagination( $wp_query ); ?>
</div>
<?php if( $sidebar_layout == 'right-sidebar' ) { ?>
<div class="<?php echo esc_attr( $sidebar_right_class ); ?>"><?php get_sidebar(); ?></div>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
<?php get_footer();