-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-product.php
140 lines (107 loc) · 6.91 KB
/
archive-product.php
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php get_header(); ?>
<div class="wrap">
<?php if ( have_posts() ) : ?>
<?php
$show_blog_archive_title = (bool)get_theme_mod( 'sed_show_blog_archive_title' , '1' );
$show_blog_archive_description = (bool)get_theme_mod( 'sed_show_blog_archive_description' , '1' );
if( $show_blog_archive_title === true || $show_blog_archive_description === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_title === false && $show_blog_archive_description === false) ? "hide" : "";
?>
<header class="page-header <?php echo esc_attr( $hide_class ) ;?>">
<?php
if( $show_blog_archive_title === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_title === false) ? "hide" : "";
the_archive_title('<h1 class="page-title '. esc_attr( $hide_class ) .'">', '</h1>');
}
if( $show_blog_archive_description === true || site_editor_app_on() ) {
$hide_class = ($show_blog_archive_description === false) ? "hide" : "";
the_archive_description( '<div class="taxonomy-description '. esc_attr( $hide_class ) .'">', '</div>' );
}
?>
</header><!-- .page-header -->
<?php } ?>
<?php endif; ?>
<div id="primary" class="content-area blog-content-area archive-custom-post-type">
<main id="main" class="site-main" role="main">
<section class="content">
<div class="row">
<div class="col-sm-12">
<?php sed_iott_breadcrumbs(); ?>
</div>
</div>
<div class="content__header">
<div class="row">
<div class="col-md-12 col-lg-6">
<form method="get" class="form-inline">
<div class="form-group">
<select class="iott-change-sort-select" name="productSortBy" data-value="orderby">
<?php
$orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : "data_desc";
?>
<option value="data_desc" <?php if ( $orderby == "data_desc") { echo "selected"; } ?>>تاریخ: نزولی</option>
<option value="date_asc" <?php if ( $orderby == "date_asc") { echo "selected"; } ?>>تاریخ: صعولی</option>
<option value="title_asc" <?php if ( $orderby == "title_asc") { echo "selected"; } ?>>بر اساس حروف الفبا: صعودی</option>
<option value="title_desc" <?php if ( $orderby == "title_desc") { echo "selected"; } ?>>بر اساس حروف الفبا: نزولی</option>
</select>
</div>
<div class="form-group">
<select class="iott-change-sort-select" name="productCount" data-value="postperpage">
<?php
$postperpage = isset( $_GET['postperpage'] ) ? $_GET['postperpage'] : 12;
?>
<option value="12" <?php if ( $postperpage == "12" ) { echo "selected"; } ?>>نمایش در هر صفحه: ۱۲</option>
<option value="24" <?php if ( $postperpage == "24" ) { echo "selected"; } ?>>نمایش در هر صفحه: ۲۴</option>
<option value="48" <?php if ( $postperpage == "48" ) { echo "selected"; } ?>>نمایش در هر صفحه: ۴۸</option>
</select>
</div>
</form>
</div>
<div class="col-md-12 col-lg-6">
<?php wp_pagenavi(); ?>
</div>
</div>
</div>
<div class="row">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="col-sm-6 col-md-4">
<article id="post-<?php the_ID(); ?>" <?php post_class('post custom-post-item'); ?>>
<?php if ('' !== get_the_post_thumbnail() && !is_single()) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php
$attachment_id = get_post_thumbnail_id();
$img = get_sed_attachment_image_html( $attachment_id , "" , "400X400" );
?>
<?php
if ( $img ) {
echo $img['thumbnail'];
}
?>
<?php //the_post_thumbnail('s1x1'); ?>
</a>
</div>
<?php endif; ?>
<header class="entry-header entry-header--archive">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<span><?php the_title(); ?></span>
<small><?php iott_the_field('subtitle'); ?></small>
</a>
</header>
</article>
</div>
<?php endwhile; ?>
</div>
<div class="row">
<div class="col-sm-12">
<?php wp_pagenavi(); ?>
</div>
</div>
<?php else :
echo '<h2 class="text-center">صفحه مورد نظر یافت نشد!</h2>';
endif; ?>
</section>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .wrap -->
<?php get_footer();