-
Notifications
You must be signed in to change notification settings - Fork 2
/
archive.php
37 lines (32 loc) · 1.21 KB
/
archive.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
<?php
/**
* The template file for showing archive pages in WordPress
*
* To show archives pages in WordPress, you can use from this template file.
*
* @package Theme_Name_Name_Space
* @version 1.0.1
* @author Mehdi Soltani <[email protected]>
* @link https://wpwebmaster.ir
*/
get_header();
get_template_part( 'template-parts/header/header', 'menu' );
/*
* Note 1:
* You must consider that msn-events-sample and msn-program-sample are
* sample post types in this example. I have always activated any
* custom post type, from plugins. This is based on WordPress best practice.
* Note 2:
* I have used from several template parts for loop throw archive pages.
* The reason is in many cases, I use from separated design for each of
* post types and that's why that I have used from separated files.
* */
if ( 'msn-events-sample' == get_post_type() ) {
get_template_part( 'template-parts/archives/events-archive-page' );
} elseif ( 'msn-programs-sample' == get_post_type() ) {
get_template_part( 'template-parts/archives/programs-archive-page' );
} else {
get_template_part( 'template-parts/archives/main-archive-page' );
}
get_template_part( 'template-parts/footer/footer', 'menu' );
get_footer();