-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpage.php
executable file
·45 lines (39 loc) · 1.82 KB
/
page.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
<?php
/*
* All globally availbile ACF data is loaded here.
*/
include(__DIR__.'/lib/data.php');
include(get_template_part_acf('templates/partials/header'));
echo '<!-- master/page -->';
while (have_posts()) : the_post();
if (is_front_page()):
echo '<!-- template: templates/content-home -->';
include(get_template_part_acf('templates/content', 'home'));
else:
if (is_sub_page($post)):
$patent = get_post($post->post_parent);
if (check_path('/templates/sub-'.$post->post_name.'.php')):
echo '<!-- template: templates/sub-'.$post->post_name.' -->';
include(get_template_part_acf('templates/sub', $post->post_name));
elseif (check_path('/templates/content-'.$patent->post_name.'.php')):
echo '<!-- template: templates/content-'.$patent->post_name.' -->';
include(get_template_part_acf('templates/content', $patent->post_name));
else:
echo '<!-- template: templates/content-page.php -->';
include(get_template_part_acf('templates/content', 'page'));
endif;
// Single Page
elseif (check_path('/templates/content-' . $post->post_name . '.php')):
echo '<!-- template: templates/content-' . $post->post_name . ' -->';
include(get_template_part_acf('templates/content', $post->post_name));
// WooCommerce Product Listing
elseif (show_woo_listing()):
echo '<!-- template: templates/woo-listing -->';
include(get_template_part_acf('templates/woo', 'listing'));
else:
echo '<!-- template: templates/content-page -->';
include(get_template_part_acf('templates/content', 'page'));
endif;
endif;
endwhile;
include(get_template_part_acf('templates/partials/footer'));