-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingle.php
executable file
·47 lines (38 loc) · 1.72 KB
/
single.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
<?php
/*
* All globally availbile ACF data is loaded here.
*/
include(__DIR__.'/lib/data.php');
include(get_template_part_acf('templates/partials/header'));
echo '<!-- master/single -->';
if (have_posts()):
while (have_posts()):
the_post();
// Post Format
if (check_path('/templates/format-' . get_post_format() . '.php')):
echo '<!-- template: templates/format-' . get_post_format() . ' -->';
include(get_template_part_acf('templates/format', get_post_format()));
// Fallback for missing Post Formats
elseif (get_post_type() == 'post' && ! get_post_format()):
echo '<!-- template: templates/format-standard -->';
include(get_template_part_acf('templates/format', 'standard'));
// Attachment
elseif (is_attachment()):
echo '<!-- template: templates/single-attachment.php -->';
include(get_template_part_acf('templates/single', 'attachment'));
// Custom Post Type
elseif (check_path('/templates/single-'.get_post_type().'.php')):
echo '<!-- template: templates/single-'.get_post_type().'.php -->';
include(get_template_part_acf('templates/single', get_post_type()));
// WooCommerce Single Product
elseif (function_exists('is_product') and is_product()):
echo '<!-- template: woo/single -->';
include(get_template_part_acf('templates/woo', 'single'));
// If everything fails use content-single.php
else:
echo '<!-- template: templates/content-single -->';
include(get_template_part_acf('templates/format', 'standard'));
endif;
endwhile;
endif;
include(get_template_part_acf('templates/partials/footer'));