-
Notifications
You must be signed in to change notification settings - Fork 2
/
archive.php
34 lines (27 loc) · 1.01 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
<?php
/*
* All globally availbile ACF data is loaded here.
*/
include(__DIR__.'/lib/data.php');
include(get_template_part_acf('templates/partials/header'));
echo '<!-- master/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_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));
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'));