-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patharchive.php
More file actions
37 lines (30 loc) · 1.2 KB
/
archive.php
File metadata and controls
37 lines (30 loc) · 1.2 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
<?php
/*
* All globally availbile ACF data is loaded here.
*/
include(__THEME_DATA__.'/lib/data.php');
include get_template_part_acf('templates/partials/header');
echo '<!-- main/archive -->';
if (have_posts()):
if (is_archive()):
$post_type = get_post_type();
if ($post_type) {
$post_type_data = get_post_type_object($post_type);
$post_type_slug = ($post_type !== 'post') ? $post_type_data->rewrite['slug'] : '';
}
if (check_path('/templates/archive-'.$post_type_slug.'.php')):
echo '<!-- template: index/archive-'.$post_type_slug.' -->';
include get_template_part_acf('templates/archive', $post_type_slug);
elseif (is_author()):
echo '<!-- template: templates/archive-author -->';
include get_template_part_acf('templates/archive', 'author');
else:
echo '<!-- template: index/archive -->';
include get_template_part_acf('templates/archive', 'default');
endif;
endif;
else:
echo '<!-- template: index/no_posts -->';
include get_template_part_acf('templates/archive', 'default');
endif;
include get_template_part_acf('templates/partials/footer');